Skip to content

Improve Only Flag for Test #518

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading