diff --git a/tools/buildbot/master.cfg b/tools/buildbot/master.cfg index 0a8a6620cc..54d3a324a2 100644 --- a/tools/buildbot/master.cfg +++ b/tools/buildbot/master.cfg @@ -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", diff --git a/tools/data/rpc/RPCClasses.h b/tools/data/rpc/RPCClasses.h new file mode 100644 index 0000000000..ab90b530e7 --- /dev/null +++ b/tools/data/rpc/RPCClasses.h @@ -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 + diff --git a/tools/data/rpc/class.cpp b/tools/data/rpc/class.cpp new file mode 100644 index 0000000000..f7831980c0 --- /dev/null +++ b/tools/data/rpc/class.cpp @@ -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 >}, + RPC_METHOD_END + }; + static rpc_class c = {"{{name}}", funcs, NULL}; + return &c; + } +private: + {{name}} o; +}; diff --git a/tools/host_tests/serial_nc_rx_auto.py b/tools/host_tests/serial_nc_rx_auto.py index cd12ebe611..59975dbeb7 100644 --- a/tools/host_tests/serial_nc_rx_auto.py +++ b/tools/host_tests/serial_nc_rx_auto.py @@ -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" diff --git a/tools/host_tests/serial_nc_tx_auto.py b/tools/host_tests/serial_nc_tx_auto.py index 549bbecb3c..707c4763af 100644 --- a/tools/host_tests/serial_nc_tx_auto.py +++ b/tools/host_tests/serial_nc_tx_auto.py @@ -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" diff --git a/tools/host_tests/tcpecho_client.py b/tools/host_tests/tcpecho_client.py index 303f002ab8..6122a1c8be 100644 --- a/tools/host_tests/tcpecho_client.py +++ b/tools/host_tests/tcpecho_client.py @@ -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 diff --git a/tools/host_tests/tcpecho_server.py b/tools/host_tests/tcpecho_server.py index 4a68bd9ee7..e98da63890 100644 --- a/tools/host_tests/tcpecho_server.py +++ b/tools/host_tests/tcpecho_server.py @@ -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) diff --git a/tools/host_tests/tcpecho_server_loop.py b/tools/host_tests/tcpecho_server_loop.py index be95f1319a..cc11ed0d96 100644 --- a/tools/host_tests/tcpecho_server_loop.py +++ b/tools/host_tests/tcpecho_server_loop.py @@ -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 diff --git a/tools/host_tests/udpecho_client.py b/tools/host_tests/udpecho_client.py index 1ff833f175..af32601636 100644 --- a/tools/host_tests/udpecho_client.py +++ b/tools/host_tests/udpecho_client.py @@ -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 diff --git a/tools/host_tests/udpecho_server.py b/tools/host_tests/udpecho_server.py index f6074332e4..7f7e899f2b 100644 --- a/tools/host_tests/udpecho_server.py +++ b/tools/host_tests/udpecho_server.py @@ -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):