mirror of https://github.com/ARMmbed/mbed-os.git
Ported changes from mbedmicro/mbed
parent
dda07f556f
commit
c182b46fcd
|
@ -286,24 +286,24 @@ from buildbot.config import BuilderConfig
|
|||
|
||||
c['builders'] = []
|
||||
|
||||
copy_private_settings = ShellCommand(name = "copy private_settings.py",
|
||||
command = "cp ../private_settings.py workspace_tools/private_settings.py",
|
||||
copy_mbed_settings = ShellCommand(name = "copy mbed_settings.py",
|
||||
command = "cp ../mbed_settings.py mbed_settings.py",
|
||||
haltOnFailure = True,
|
||||
description = "Copy private_settings.py")
|
||||
description = "Copy mbed_settings.py")
|
||||
|
||||
mbed_build_release = BuildFactory()
|
||||
mbed_build_release.addStep(git_clone)
|
||||
mbed_build_release.addStep(copy_private_settings)
|
||||
mbed_build_release.addStep(copy_mbed_settings)
|
||||
|
||||
for target_name, toolchains in OFFICIAL_MBED_LIBRARY_BUILD:
|
||||
builder_name = "All_TC_%s" % target_name
|
||||
mbed_build = BuildFactory()
|
||||
mbed_build.addStep(git_clone)
|
||||
mbed_build.addStep(copy_private_settings)
|
||||
mbed_build.addStep(copy_mbed_settings)
|
||||
# Adding all chains for target
|
||||
for toolchain in toolchains:
|
||||
build_py = BuildCommand(name = "Build %s using %s" % (target_name, toolchain),
|
||||
command = "python workspace_tools/build.py -m %s -t %s" % (target_name, toolchain),
|
||||
command = "python tools/build.py -m %s -t %s" % (target_name, toolchain),
|
||||
haltOnFailure = True,
|
||||
warnOnWarnings = True,
|
||||
description = "Building %s using %s" % (target_name, toolchain),
|
||||
|
@ -314,12 +314,12 @@ for target_name, toolchains in OFFICIAL_MBED_LIBRARY_BUILD:
|
|||
|
||||
if target_name in OFFICIAL_MBED_TESTBED_SUPPORTED_HARDWARE:
|
||||
copy_example_test_spec_json = ShellCommand(name = "Copy example_test_spec.json",
|
||||
command = "cp ../example_test_spec.json workspace_tools/data/example_test_spec.json",
|
||||
command = "cp ../example_test_spec.json tools/data/example_test_spec.json",
|
||||
haltOnFailure = True,
|
||||
description = "Copy example_test_spec.json")
|
||||
|
||||
autotest_py = ShellCommand(name = "Running autotest.py for %s" % (target_name),
|
||||
command = "python workspace_tools/autotest.py workspace_tools/data/example_test_spec.json",
|
||||
command = "python tools/autotest.py tools/data/example_test_spec.json",
|
||||
haltOnFailure = True,
|
||||
description = "Running autotest.py")
|
||||
|
||||
|
@ -337,12 +337,12 @@ for target_name, toolchains in OFFICIAL_MBED_LIBRARY_BUILD:
|
|||
factory=mbed_build))
|
||||
|
||||
# copy_example_test_spec_json = ShellCommand(name = "Copy example_test_spec.json",
|
||||
# command = "cp ../example_test_spec.json workspace_tools/data/example_test_spec.json",
|
||||
# command = "cp ../example_test_spec.json tools/data/example_test_spec.json",
|
||||
# haltOnFailure = True,
|
||||
# description = "Copy example_test_spec.json")
|
||||
|
||||
singletest_py = TestCommand(name = "Running Target Tests",
|
||||
command = "python workspace_tools/singletest.py -i workspace_tools/test_spec.json -M workspace_tools/muts_all.json",
|
||||
command = "python tools/singletest.py -i tools/test_spec.json -M tools/muts_all.json",
|
||||
haltOnFailure = True,
|
||||
warnOnWarnings = True,
|
||||
description = "Running Target Tests",
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
/* mbed Microcontroller Library
|
||||
* Copyright (c) 2006-2012 ARM Limited
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
#ifndef MBED_CLASSES_H
|
||||
#define MBED_CLASSES_H
|
||||
|
||||
#include "rpc.h"
|
||||
|
||||
namespace mbed {
|
||||
|
||||
{{classes}}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
class Rpc{{name}} : public RPC {
|
||||
public:
|
||||
Rpc{{name}}({{cons_proto}}) : RPC(name), o({{cons_call}}) {}
|
||||
|
||||
{{methods}}
|
||||
|
||||
virtual const struct rpc_method *get_rpc_methods() {
|
||||
static const rpc_method rpc_methods[] = {
|
||||
{{rpc_methods}},
|
||||
RPC_METHOD_SUPER(RPC)
|
||||
};
|
||||
return rpc_methods;
|
||||
}
|
||||
static struct rpc_class *get_rpc_class() {
|
||||
static const rpc_function funcs[] = {
|
||||
{"new", rpc_function_caller<const char*, {{cons_type}}, &RPC::construct<Rpc{{name}}, {{cons_type}}> >},
|
||||
RPC_METHOD_END
|
||||
};
|
||||
static rpc_class c = {"{{name}}", funcs, NULL};
|
||||
return &c;
|
||||
}
|
||||
private:
|
||||
{{name}} o;
|
||||
};
|
|
@ -25,6 +25,29 @@ class SerialNCRXTest():
|
|||
|
||||
def test(self, selftest):
|
||||
selftest.mbed.flush();
|
||||
# Wait 0.5 seconds to ensure mbed is listening
|
||||
time.sleep(0.5)
|
||||
|
||||
#handshake with target to sync test start
|
||||
selftest.mbed.serial_write("S");
|
||||
|
||||
strip_chars = string.whitespace + "\0"
|
||||
|
||||
out_str = selftest.mbed.serial_readline()
|
||||
|
||||
if not out_str:
|
||||
selftest.notify("HOST: No output detected")
|
||||
return selftest.RESULT_IO_SERIAL
|
||||
|
||||
out_str_stripped = out_str.strip(strip_chars)
|
||||
|
||||
if out_str_stripped != "RX OK - Start NC test":
|
||||
selftest.notify("HOST: Unexpected output. Expected 'RX OK - Expected' but received '%s'" % out_str_stripped)
|
||||
return selftest.RESULT_FAILURE
|
||||
|
||||
# Wait 0.5 seconds to ensure mbed is listening
|
||||
time.sleep(0.5)
|
||||
|
||||
selftest.mbed.serial_write("E");
|
||||
|
||||
strip_chars = string.whitespace + "\0"
|
||||
|
|
|
@ -25,6 +25,9 @@ class SerialNCTXTest():
|
|||
|
||||
def test(self, selftest):
|
||||
selftest.mbed.flush();
|
||||
# Wait 0.5 seconds to ensure mbed is listening
|
||||
time.sleep(0.5)
|
||||
|
||||
selftest.mbed.serial_write("S");
|
||||
|
||||
strip_chars = string.whitespace + "\0"
|
||||
|
|
|
@ -18,7 +18,7 @@ import socket
|
|||
import string, random
|
||||
from time import time
|
||||
|
||||
from private_settings import SERVER_ADDRESS
|
||||
from mbed_settings import SERVER_ADDRESS
|
||||
|
||||
ECHO_PORT = 7
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ limitations under the License.
|
|||
from SocketServer import BaseRequestHandler, TCPServer
|
||||
from time import time
|
||||
|
||||
from private_settings import LOCALHOST
|
||||
from mbed_settings import LOCALHOST
|
||||
|
||||
MAX_INDEX = 126
|
||||
MEGA = float(1024 * 1024)
|
||||
|
|
|
@ -20,7 +20,7 @@ from os.path import join, abspath, dirname
|
|||
ROOT = abspath(join(dirname(__file__), "..", ".."))
|
||||
sys.path.insert(0, ROOT)
|
||||
|
||||
from tools.private_settings import LOCALHOST
|
||||
from mbed_settings import LOCALHOST
|
||||
from SocketServer import BaseRequestHandler, TCPServer
|
||||
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ from socket import socket, AF_INET, SOCK_DGRAM
|
|||
import string, random
|
||||
from time import time
|
||||
|
||||
from private_settings import CLIENT_ADDRESS
|
||||
from mbed_settings import CLIENT_ADDRESS
|
||||
|
||||
ECHO_PORT = 7
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
"""
|
||||
from SocketServer import BaseRequestHandler, UDPServer
|
||||
from private_settings import SERVER_ADDRESS
|
||||
from mbed_settings import SERVER_ADDRESS
|
||||
|
||||
class UDP_EchoHandler(BaseRequestHandler):
|
||||
def handle(self):
|
||||
|
|
Loading…
Reference in New Issue