diff options
| author | bbareth <179921368+BBareth@users.noreply.github.com> | 2026-11-22 18:11:11 +0100 |
|---|---|---|
| committer | bbareth <179921368+BBareth@users.noreply.github.com> | 2026-11-22 18:11:11 +0100 |
| commit | 2e4c86c2d2f8958e6e651f00bbf4c10ff1806d81 (patch) | |
| tree | 265d3967d4ff5634f0a62645db48a3ee8e884ea6 /scripts | |
| parent | 49475796c226c8511b9470bf97a4daf57b8af323 (diff) | |
run_wine_tests: reject malformed CTest inventories before launching
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/run_wine_tests.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/run_wine_tests.py b/scripts/run_wine_tests.py index 0a02525e5..5bdc5dd72 100644 --- a/scripts/run_wine_tests.py +++ b/scripts/run_wine_tests.py | |||
| @@ -202,10 +202,11 @@ def read_tests(path: str) -> list[dict] | None: | |||
| 202 | except (OSError, ValueError) as e: | 202 | except (OSError, ValueError) as e: |
| 203 | print(f"ERROR: cannot read {path}: {e}", file=sys.stderr) | 203 | print(f"ERROR: cannot read {path}: {e}", file=sys.stderr) |
| 204 | return None | 204 | return None |
| 205 | if not isinstance(doc, dict) or not isinstance(doc.get("tests", []), list): | 205 | tests = doc.get("tests") if isinstance(doc, dict) else None |
| 206 | if not isinstance(tests, list) or not all(isinstance(t, dict) for t in tests): | ||
| 206 | print(f"ERROR: {path} is not the output of ctest --show-only=json-v1", file=sys.stderr) | 207 | print(f"ERROR: {path} is not the output of ctest --show-only=json-v1", file=sys.stderr) |
| 207 | return None | 208 | return None |
| 208 | return doc.get("tests", []) | 209 | return tests |
| 209 | 210 | ||
| 210 | 211 | ||
| 211 | def main() -> int: | 212 | def main() -> int: |