Tweaked test/bench id globbing to avoid duplicating cases

Before, globs that match both the suite name and case name would cause
end up running the case twice. Which is a bit of a problem, since all
cases contain their suite name as a prefix...

  test_f* => run test_files
             |-> run test_files_hello
             |-> run test_files_trunc
             ...
             run test_files_hello
             run test_files_trunc
             ...

Now we only run matching test cases if no suites were found.

This has the side-effect of making the universal glob, "*", equivalent
to no test ids, which is nice:

  $ ./scripts/test.py -j -b '*'  # equivalent
  $ ./scripts/test.py -j -b      #

This is useful for running a specific problematic test first before
running the all of the tests:

  $ ./scripts/test.py -j -b test_files_trunc '*'
This commit is contained in:
Christopher Haster
2024-05-29 14:33:01 -05:00
parent c648f96dc5
commit 3c5319e125
2 changed files with 8 additions and 6 deletions

View File

@@ -833,9 +833,10 @@ def find_ids(runner, test_ids=[], **args):
test_ids__.extend(suite
for suite in expected_suite_perms.keys()
if fnmatch.fnmatch(suite, name))
test_ids__.extend(case_
for case_ in expected_case_perms.keys()
if fnmatch.fnmatch(case_, name))
if not test_ids__:
test_ids__.extend(case_
for case_ in expected_case_perms.keys()
if fnmatch.fnmatch(case_, name))
# literal suite
elif name in expected_suite_perms:
test_ids__.append(id)