Skip to content

Commit

Permalink
Improve Only Flag for Test (#518)
Browse files Browse the repository at this point in the history
  • Loading branch information
okBrian authored Jul 11, 2024
1 parent 99c91b8 commit a9c0e32
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion toolchain/mfc/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def add_common_arguments(p, mask = None):
test.add_argument("-l", "--list", action="store_true", help="List all available tests.")
test.add_argument("-f", "--from", default=test_cases[0].get_uuid(), type=str, help="First test UUID to run.")
test.add_argument("-t", "--to", default=test_cases[-1].get_uuid(), type=str, help="Last test UUID to run.")
test.add_argument("-o", "--only", nargs="+", type=str, default=[], metavar="L", help="Only run tests with UUIDs or hashes L.")
test.add_argument("-o", "--only", nargs="+", type=str, default=[], metavar="L", help="Only run tests with specified properties.")
test.add_argument("-r", "--relentless", action="store_true", default=False, help="Run all tests, even if multiple fail.")
test.add_argument("-a", "--test-all", action="store_true", default=False, help="Run the Post Process Tests too.")
test.add_argument("-%", "--percent", type=int, default=100, help="Percentage of tests to run.")
Expand Down
13 changes: 5 additions & 8 deletions toolchain/mfc/test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,15 @@ def __filter(cases_) -> typing.List[TestCase]:
raise MFCException("Testing: Your specified range [--from,--to] is incorrect. Please ensure both IDs exist and are in the correct order.")

if len(ARG("only")) > 0:
for i, case in enumerate(cases[:]):
for case in cases[:]:
case: TestCase

doKeep = False
for o in ARG("only"):
if str(o) == case.get_uuid():
doKeep = True
break

if not doKeep:
checkCase = case.trace.split(" -> ")
checkCase.append(case.get_uuid())
if not set(ARG("only")).issubset(set(checkCase)):
cases.remove(case)


for case in cases[:]:
if case.ppn > 1 and not ARG("mpi"):
cases.remove(case)
Expand Down

0 comments on commit a9c0e32

Please sign in to comment.