autotest: correct run_one_test case (vehicle.testname case)

This commit is contained in:
Peter Barker 2021-01-21 22:09:34 +11:00 committed by Peter Barker
parent 1fec88af21
commit 2e2e34d784
1 changed files with 5 additions and 6 deletions

View File

@ -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)