From 2e2e34d784060fd6d0fbd1d61023d31fec4f35eb Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 21 Jan 2021 22:09:34 +1100 Subject: [PATCH] autotest: correct run_one_test case (vehicle.testname case) --- Tools/autotest/autotest.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Tools/autotest/autotest.py b/Tools/autotest/autotest.py index 688c57f43a..55c0b9cdaf 100755 --- a/Tools/autotest/autotest.py +++ b/Tools/autotest/autotest.py @@ -360,6 +360,7 @@ suplementary_test_binary_map = { "test.CAN": "sitl_periph_gps.AP_Periph", } +from common import Test def run_specific_test(step, *args, **kwargs): t = split_specific_test_step(step) if t is None: @@ -372,12 +373,10 @@ def run_specific_test(step, *args, **kwargs): print("Got %s" % str(tester)) for a in tester.tests(): - if hasattr(a, 'name'): - name = a.name - else: - name = a[0] - print("Got %s" % (name)) - if name == test: + if not hasattr(a, 'name'): + a = Test(a[0], a[1], a[2]) + print("Got %s" % (a.name)) + if a.name == test: return tester.run_tests([a]) print("Failed to find test %s on %s" % (test, testname)) sys.exit(1)