From 6690db1444cda780c30f71f3676d37a8c9e502c5 Mon Sep 17 00:00:00 2001 From: Przemek Wirkus Date: Wed, 24 Sep 2014 11:18:57 +0100 Subject: [PATCH] Feature: Device detection via serial - part 2 --- workspace_tools/host_tests/host_test.py | 2 +- workspace_tools/test_api.py | 5 ++++- workspace_tools/tests.py | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/workspace_tools/host_tests/host_test.py b/workspace_tools/host_tests/host_test.py index 3fdcb10881..a35cb8466d 100644 --- a/workspace_tools/host_tests/host_test.py +++ b/workspace_tools/host_tests/host_test.py @@ -42,7 +42,7 @@ class Mbed: parser.add_option("-m", "--micro", dest="micro", - help="The target microcontroller ", + help="The target microcontroller", metavar="MICRO") parser.add_option("-p", "--port", diff --git a/workspace_tools/test_api.py b/workspace_tools/test_api.py index f1f589768d..6d8c4b633d 100644 --- a/workspace_tools/test_api.py +++ b/workspace_tools/test_api.py @@ -732,6 +732,7 @@ class SingleTestRunner(object): host_test_verbose = self.opts_verbose_test_result_only or self.opts_verbose host_test_reset = self.opts_mut_reset_type if reset_type is None else reset_type single_test_result, single_test_output = self.run_host_test(test.host_test, disk, port, duration, + micro=target_name, verbose=host_test_verbose, reset=host_test_reset, reset_tout=reset_tout) @@ -797,7 +798,7 @@ class SingleTestRunner(object): result = test_all_result[0] return result - def run_host_test(self, name, disk, port, duration, reset=None, reset_tout=None, verbose=False, extra_serial=None): + def run_host_test(self, name, disk, port, duration, micro=None, reset=None, reset_tout=None, verbose=False, extra_serial=None): """ Function creates new process with host test configured with particular test case. Function also is pooling for serial port activity from process to catch all data printed by test runner and host test during test execution @@ -806,6 +807,8 @@ class SingleTestRunner(object): cmd = ["python", "%s.py" % name, '-p', port, '-d', disk, '-t', str(duration)] # Add extra parameters to host_test + if micro is not None: + cmd += ["-m", micro] if extra_serial is not None: cmd += ["-e", extra_serial] if reset is not None: diff --git a/workspace_tools/tests.py b/workspace_tools/tests.py index 360d9fbe03..e407072663 100644 --- a/workspace_tools/tests.py +++ b/workspace_tools/tests.py @@ -889,6 +889,7 @@ TESTS = [ "source_dir": join(TEST_DIR, "mbed", "detect"), "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], "automated": True, + "host_test" : "detect_auto", }, ]