Testrunner: Accept test_name by run-test number
The change allows the testrunner to accept test numbers for running
a particular test. It runs all the tests for which the prefix matches
with the passed test name.
For test name "001-H", it will run 001-HelloWorld
However, for test name "001", it will run 001-Main and 001-HelloWorld
If it doesn't find any test with matching prefix, it raises ValueError.
Test: Verified by running locally
Bug: 35260706
Change-Id: Ib132d6635b22ade1fd96728ba629fe7d580ba6cf
diff --git a/test/testrunner/testrunner.py b/test/testrunner/testrunner.py
index ce14ff1..92ecc9d 100755
--- a/test/testrunner/testrunner.py
+++ b/test/testrunner/testrunner.py
@@ -610,8 +610,12 @@
variants required to run the test. Again, it returns the test_name
without the variant information like 001-HelloWorld.
"""
- if test_name in RUN_TEST_SET:
- return {test_name}
+ test_set = set()
+ for test in RUN_TEST_SET:
+ if test.startswith(test_name):
+ test_set.add(test)
+ if test_set:
+ return test_set
regex = '^test-art-'
regex += '(' + '|'.join(VARIANT_TYPE_DICT['target']) + ')-'
@@ -643,6 +647,7 @@
DEBUGGABLE_TYPES.add(match.group(11))
ADDRESS_SIZES.add(match.group(13))
return {match.group(12)}
+ raise ValueError(test_name + " is not a valid test")
def parse_option():
@@ -786,10 +791,10 @@
sys.exit(0)
except SystemExit:
pass
- except:
+ except Exception, e:
print_analysis()
+ print_text(str(e))
sys.exit(1)
-
if __name__ == '__main__':
main()