Skip to content

Commit

Permalink
vmcheck: Honor TESTS=
Browse files Browse the repository at this point in the history
Minor regression from the multitest reimplementation, but it's really handy for
the "debug and fix a test" case.
  • Loading branch information
cgwalters committed Mar 17, 2017
1 parent 7017602 commit 803e5da
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion tests/vmcheck/multitest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 803e5da

Please sign in to comment.