diff options
| author | AvantBras <charlie.vernotrochey@gmail.com> | 2026-11-22 17:13:19 +0100 |
|---|---|---|
| committer | AvantBras <charlie.vernotrochey@gmail.com> | 2026-11-22 17:13:19 +0100 |
| commit | fc52e967234fbeae47f97462667f210a7887406e (patch) | |
| tree | 9e54bb9e110f3af92b1e24ef6197df0e9c919990 /scripts/run_gpu_tests.py | |
| parent | 4eb6155d3ac4f9d3fadb0d095c4ce13e76783615 (diff) | |
Tests: let focused GPU runs require a pass (TEST-364)
Diffstat (limited to 'scripts/run_gpu_tests.py')
| -rw-r--r-- | scripts/run_gpu_tests.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py index 025504fb8..757b94d78 100644 --- a/scripts/run_gpu_tests.py +++ b/scripts/run_gpu_tests.py | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | """Assemble, translate, and run the synthetic RDNA2->SPIR-V GPU test suite on Vulkan. | 1 | """Assemble, translate, and run the synthetic RDNA2->SPIR-V GPU test suite on Vulkan. |
| 2 | 2 | ||
| 3 | Usage: | 3 | Usage: |
| 4 | python -I scripts/run_gpu_tests.py [--llvm-mc CMD] [--build DIR] [--work DIR] [--filter SUBSTR] | 4 | python -I scripts/run_gpu_tests.py [--llvm-mc CMD] [--build DIR] [--work DIR] [--filter SUBSTR] [--require-pass] |
| 5 | 5 | ||
| 6 | --llvm-mc (or LLVM_MC) is a path or a whole command, e.g. "wsl -d Ubuntu -e /usr/lib/llvm-21/bin/llvm-mc". | 6 | --llvm-mc (or LLVM_MC) is a path or a whole command, e.g. "wsl -d Ubuntu -e /usr/lib/llvm-21/bin/llvm-mc". |
| 7 | """ | 7 | """ |
| @@ -598,6 +598,7 @@ def main() -> int: | |||
| 598 | "subfolder that has the test programs is found by itself") | 598 | "subfolder that has the test programs is found by itself") |
| 599 | ap.add_argument("--work", default=None) | 599 | ap.add_argument("--work", default=None) |
| 600 | ap.add_argument("--filter", default="") | 600 | ap.add_argument("--filter", default="") |
| 601 | ap.add_argument("--require-pass", action="store_true", help="exit 1 if no GPU test passes") | ||
| 601 | a = ap.parse_args() | 602 | a = ap.parse_args() |
| 602 | # Some test programs run with their working directory in <work>/spirv (vk_texture_test), so a relative path | 603 | # Some test programs run with their working directory in <work>/spirv (vk_texture_test), so a relative path |
| 603 | # given here would point somewhere else for them. | 604 | # given here would point somewhere else for them. |
| @@ -1274,7 +1275,12 @@ def run_suite(a, work: str) -> int: | |||
| 1274 | skipped += ok is None | 1275 | skipped += ok is None |
| 1275 | print(f" {tag:4s} {name:<20s} {detail}") | 1276 | print(f" {tag:4s} {name:<20s} {detail}") |
| 1276 | print(f"\n{passed}/{len(results)} passed" + (f", {skipped} skipped" if skipped else "")) | 1277 | print(f"\n{passed}/{len(results)} passed" + (f", {skipped} skipped" if skipped else "")) |
| 1277 | return 0 if passed + skipped == len(results) else 1 | 1278 | if passed + skipped != len(results): |
| 1279 | return 1 | ||
| 1280 | if getattr(a, "require_pass", False) and not passed: | ||
| 1281 | print("error: --require-pass: no GPU tests passed", file=sys.stderr) | ||
| 1282 | return 1 | ||
| 1283 | return 0 | ||
| 1278 | 1284 | ||
| 1279 | 1285 | ||
| 1280 | if __name__ == "__main__": | 1286 | if __name__ == "__main__": |