From 803e5da953b4d991b3f11e646f0ca54eca6df41b Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Fri, 17 Mar 2017 15:03:39 -0400 Subject: [PATCH] vmcheck: Honor TESTS= Minor regression from the multitest reimplementation, but it's really handy for the "debug and fix a test" case. --- tests/vmcheck/multitest.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/tests/vmcheck/multitest.py b/tests/vmcheck/multitest.py index ed19e88cad..c9b27390fc 100755 --- a/tests/vmcheck/multitest.py +++ b/tests/vmcheck/multitest.py @@ -13,11 +13,32 @@ def main(): for host in sys.argv[1:]: hosts.append(Host(host)) - for test in glob.iglob(os.path.join(sys.path[0], "test-*.sh")): + requested_tests_spec = os.environ.get('TESTS') + if requested_tests_spec is not None: + requested_tests = requested_tests_spec.split() + else: + requested_tests = None + + tests = glob.iglob(os.path.join(sys.path[0], "test-*.sh")) + matched_tests = [] + unmatched_tests = [] + for test in tests: + testbn = os.path.basename(test) + if requested_tests is None or testbn in requested_tests: + matched_tests.append(test) + else: + unmatched_tests.append(testbn) + if len(matched_tests) == 0: + print("error: no tests match '{}': {}".format(requested_tests_spec, unmatched_tests)) + sys.exit(1) + + for test in matched_tests: host = wait_for_next_available_host(hosts) rc = host.flush() failed = failed or rc != 0 host.dispatch(test) + if len(unmatched_tests) > 0: + print("NOTE: Skipping tests not matching {}: {}".format(requested_tests_spec, unmatched_tests)) for host in hosts: rc = host.flush()