Skip to content

Commit c182b46

Browse files
committed
Ported changes from mbedmicro/mbed
1 parent dda07f5 commit c182b46

File tree

10 files changed

+99
-15
lines changed

10 files changed

+99
-15
lines changed

tools/buildbot/master.cfg

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -286,24 +286,24 @@ from buildbot.config import BuilderConfig
286286

287287
c['builders'] = []
288288

289-
copy_private_settings = ShellCommand(name = "copy private_settings.py",
290-
command = "cp ../private_settings.py workspace_tools/private_settings.py",
289+
copy_mbed_settings = ShellCommand(name = "copy mbed_settings.py",
290+
command = "cp ../mbed_settings.py mbed_settings.py",
291291
haltOnFailure = True,
292-
description = "Copy private_settings.py")
292+
description = "Copy mbed_settings.py")
293293

294294
mbed_build_release = BuildFactory()
295295
mbed_build_release.addStep(git_clone)
296-
mbed_build_release.addStep(copy_private_settings)
296+
mbed_build_release.addStep(copy_mbed_settings)
297297

298298
for target_name, toolchains in OFFICIAL_MBED_LIBRARY_BUILD:
299299
builder_name = "All_TC_%s" % target_name
300300
mbed_build = BuildFactory()
301301
mbed_build.addStep(git_clone)
302-
mbed_build.addStep(copy_private_settings)
302+
mbed_build.addStep(copy_mbed_settings)
303303
# Adding all chains for target
304304
for toolchain in toolchains:
305305
build_py = BuildCommand(name = "Build %s using %s" % (target_name, toolchain),
306-
command = "python workspace_tools/build.py -m %s -t %s" % (target_name, toolchain),
306+
command = "python tools/build.py -m %s -t %s" % (target_name, toolchain),
307307
haltOnFailure = True,
308308
warnOnWarnings = True,
309309
description = "Building %s using %s" % (target_name, toolchain),
@@ -314,12 +314,12 @@ for target_name, toolchains in OFFICIAL_MBED_LIBRARY_BUILD:
314314

315315
if target_name in OFFICIAL_MBED_TESTBED_SUPPORTED_HARDWARE:
316316
copy_example_test_spec_json = ShellCommand(name = "Copy example_test_spec.json",
317-
command = "cp ../example_test_spec.json workspace_tools/data/example_test_spec.json",
317+
command = "cp ../example_test_spec.json tools/data/example_test_spec.json",
318318
haltOnFailure = True,
319319
description = "Copy example_test_spec.json")
320320

321321
autotest_py = ShellCommand(name = "Running autotest.py for %s" % (target_name),
322-
command = "python workspace_tools/autotest.py workspace_tools/data/example_test_spec.json",
322+
command = "python tools/autotest.py tools/data/example_test_spec.json",
323323
haltOnFailure = True,
324324
description = "Running autotest.py")
325325

@@ -337,12 +337,12 @@ for target_name, toolchains in OFFICIAL_MBED_LIBRARY_BUILD:
337337
factory=mbed_build))
338338

339339
# copy_example_test_spec_json = ShellCommand(name = "Copy example_test_spec.json",
340-
# command = "cp ../example_test_spec.json workspace_tools/data/example_test_spec.json",
340+
# command = "cp ../example_test_spec.json tools/data/example_test_spec.json",
341341
# haltOnFailure = True,
342342
# description = "Copy example_test_spec.json")
343343

344344
singletest_py = TestCommand(name = "Running Target Tests",
345-
command = "python workspace_tools/singletest.py -i workspace_tools/test_spec.json -M workspace_tools/muts_all.json",
345+
command = "python tools/singletest.py -i tools/test_spec.json -M tools/muts_all.json",
346346
haltOnFailure = True,
347347
warnOnWarnings = True,
348348
description = "Running Target Tests",

tools/data/rpc/RPCClasses.h

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2006-2012 ARM Limited
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
* SOFTWARE.
21+
*/
22+
#ifndef MBED_CLASSES_H
23+
#define MBED_CLASSES_H
24+
25+
#include "rpc.h"
26+
27+
namespace mbed {
28+
29+
{{classes}}
30+
31+
}
32+
33+
#endif
34+

tools/data/rpc/class.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
class Rpc{{name}} : public RPC {
2+
public:
3+
Rpc{{name}}({{cons_proto}}) : RPC(name), o({{cons_call}}) {}
4+
5+
{{methods}}
6+
7+
virtual const struct rpc_method *get_rpc_methods() {
8+
static const rpc_method rpc_methods[] = {
9+
{{rpc_methods}},
10+
RPC_METHOD_SUPER(RPC)
11+
};
12+
return rpc_methods;
13+
}
14+
static struct rpc_class *get_rpc_class() {
15+
static const rpc_function funcs[] = {
16+
{"new", rpc_function_caller<const char*, {{cons_type}}, &RPC::construct<Rpc{{name}}, {{cons_type}}> >},
17+
RPC_METHOD_END
18+
};
19+
static rpc_class c = {"{{name}}", funcs, NULL};
20+
return &c;
21+
}
22+
private:
23+
{{name}} o;
24+
};

tools/host_tests/serial_nc_rx_auto.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,29 @@ class SerialNCRXTest():
2525

2626
def test(self, selftest):
2727
selftest.mbed.flush();
28+
# Wait 0.5 seconds to ensure mbed is listening
29+
time.sleep(0.5)
30+
31+
#handshake with target to sync test start
32+
selftest.mbed.serial_write("S");
33+
34+
strip_chars = string.whitespace + "\0"
35+
36+
out_str = selftest.mbed.serial_readline()
37+
38+
if not out_str:
39+
selftest.notify("HOST: No output detected")
40+
return selftest.RESULT_IO_SERIAL
41+
42+
out_str_stripped = out_str.strip(strip_chars)
43+
44+
if out_str_stripped != "RX OK - Start NC test":
45+
selftest.notify("HOST: Unexpected output. Expected 'RX OK - Expected' but received '%s'" % out_str_stripped)
46+
return selftest.RESULT_FAILURE
47+
48+
# Wait 0.5 seconds to ensure mbed is listening
49+
time.sleep(0.5)
50+
2851
selftest.mbed.serial_write("E");
2952

3053
strip_chars = string.whitespace + "\0"

tools/host_tests/serial_nc_tx_auto.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ class SerialNCTXTest():
2525

2626
def test(self, selftest):
2727
selftest.mbed.flush();
28+
# Wait 0.5 seconds to ensure mbed is listening
29+
time.sleep(0.5)
30+
2831
selftest.mbed.serial_write("S");
2932

3033
strip_chars = string.whitespace + "\0"

tools/host_tests/tcpecho_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import string, random
1919
from time import time
2020

21-
from private_settings import SERVER_ADDRESS
21+
from mbed_settings import SERVER_ADDRESS
2222

2323
ECHO_PORT = 7
2424

tools/host_tests/tcpecho_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from SocketServer import BaseRequestHandler, TCPServer
1818
from time import time
1919

20-
from private_settings import LOCALHOST
20+
from mbed_settings import LOCALHOST
2121

2222
MAX_INDEX = 126
2323
MEGA = float(1024 * 1024)

tools/host_tests/tcpecho_server_loop.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
ROOT = abspath(join(dirname(__file__), "..", ".."))
2121
sys.path.insert(0, ROOT)
2222

23-
from tools.private_settings import LOCALHOST
23+
from mbed_settings import LOCALHOST
2424
from SocketServer import BaseRequestHandler, TCPServer
2525

2626

tools/host_tests/udpecho_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import string, random
1919
from time import time
2020

21-
from private_settings import CLIENT_ADDRESS
21+
from mbed_settings import CLIENT_ADDRESS
2222

2323
ECHO_PORT = 7
2424

tools/host_tests/udpecho_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
limitations under the License.
1616
"""
1717
from SocketServer import BaseRequestHandler, UDPServer
18-
from private_settings import SERVER_ADDRESS
18+
from mbed_settings import SERVER_ADDRESS
1919

2020
class UDP_EchoHandler(BaseRequestHandler):
2121
def handle(self):

0 commit comments

Comments
 (0)