Added simple mbed SDK test linking against popular libraries

pull/750/head
Przemek Wirkus 2014-12-01 16:51:03 +00:00
parent 670eea7937
commit 6c22025ae0
1 changed files with 41 additions and 0 deletions

View File

@ -64,6 +64,22 @@ build_list = (
)
################################################################################
# Configure example test building (linking against external mbed SDK libraries liek fat or rtos)
linking_list = [
{"target": "LPC1768",
"toolchains": "GCC_ARM",
"tests": {"testlib" : ["MBED_2", "MBED_10", "MBED_11", "MBED_15", "MBED_16", "MBED_17"],
"eth" : ["NET_1", "NET_2", "NET_3", "NET_4"],
"fat" : ["MBED_A12", "MBED_19", "PERF_1", "PERF_2", "PERF_3"],
"rtos" : ["RTOS_1", "RTOS_2", "RTOS_3"],
"usb" : ["USB_1", "USB_2" ,"USB_3"],
}
}
]
################################################################################
# Driver
def run_builds(dry_run):
@ -80,5 +96,30 @@ def run_builds(dry_run):
if os.system(cmdline) != 0:
sys.exit(1)
def run_test_linking(dry_run):
""" Function run make.py commands to build and link simple mbed SDK
tests against few libraries to make sure there are no simple linking errors.
"""
for link in linking_list:
toolchain_list = link["toolchains"]
if type(toolchain_list) != type([]):
toolchain_list = [toolchain_list]
for toolchain in toolchain_list:
tests = link["tests"]
for test_lib in tests:
test_names = tests[test_lib]
cmdline = "python workspace_tools/make.py -m %s -t %s --%s -n %s" % (link["target"],
toolchain,
test_lib,
",".join(test_names))
print "Executing: " + cmdline
if not dry_run:
if os.system(cmdline) != 0:
sys.exit(1)
if __name__ == "__main__":
run_builds("-s" in sys.argv)
run_test_linking("-s" in sys.argv)