[build tools] Add support for globs in test names

Christopher Haster 2016-06-12 04:00:49 -05:00
parent 963892c83e
commit f83caf80dc
1 changed files with 5 additions and 2 deletions

View File

@ -21,6 +21,7 @@ TEST BUILD & RUN
import sys import sys
import os import os
import json import json
import fnmatch
ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
sys.path.insert(0, ROOT) sys.path.insert(0, ROOT)
@ -105,8 +106,10 @@ if __name__ == '__main__':
all_tests_keys = all_tests.keys() all_tests_keys = all_tests.keys()
for name in all_names: for name in all_names:
if name in all_tests_keys: if any(fnmatch.fnmatch(testname, name) for testname in all_tests):
tests[name] = all_tests[name] for testname, test in all_tests.items():
if fnmatch.fnmatch(testname, name):
tests[testname] = test
else: else:
print "[Warning] Test with name '%s' was not found in the available tests" % (name) print "[Warning] Test with name '%s' was not found in the available tests" % (name)
else: else: