diff options
| author | bbareth <179921368+BBareth@users.noreply.github.com> | 2026-11-22 23:56:00 +0100 |
|---|---|---|
| committer | bbareth <179921368+BBareth@users.noreply.github.com> | 2026-11-22 23:56:00 +0100 |
| commit | 6d3b3f9f4e524381cc059d3369ad8a97bbc585db (patch) | |
| tree | 54c33d1a1cbd4edad21c6cfa644752420df8af35 /scripts/run_wine_tests.py | |
| parent | aa2988cc555bad7ecd508b48a702adbb32fe7c95 (diff) | |
Handle malformed CTest skip codes in the Wine runner
Diffstat (limited to 'scripts/run_wine_tests.py')
| -rw-r--r-- | scripts/run_wine_tests.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/run_wine_tests.py b/scripts/run_wine_tests.py index 3e90e9ab4..b3427a2ab 100644 --- a/scripts/run_wine_tests.py +++ b/scripts/run_wine_tests.py | |||
| @@ -161,6 +161,15 @@ def run_test(test: dict, args, wine: list[str]) -> tuple[str, str]: | |||
| 161 | return "fail", "invalid CTest TIMEOUT" | 161 | return "fail", "invalid CTest TIMEOUT" |
| 162 | if ctest_timeout > 0: | 162 | if ctest_timeout > 0: |
| 163 | timeout = min(timeout, ctest_timeout) | 163 | timeout = min(timeout, ctest_timeout) |
| 164 | skip_code = props.get("SKIP_RETURN_CODE") | ||
| 165 | if skip_code is not None: | ||
| 166 | error = "invalid CTest SKIP_RETURN_CODE: expected an integer from 0 to 255" | ||
| 167 | try: | ||
| 168 | skip_code = int(str(skip_code)) | ||
| 169 | except ValueError: | ||
| 170 | return "fail", error | ||
| 171 | if not 0 <= skip_code <= 255: | ||
| 172 | return "fail", error | ||
| 164 | start = time.monotonic() | 173 | start = time.monotonic() |
| 165 | try: | 174 | try: |
| 166 | proc = subprocess.run(argv, cwd=cwd, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, | 175 | proc = subprocess.run(argv, cwd=cwd, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, |
| @@ -177,8 +186,7 @@ def run_test(test: dict, args, wine: list[str]) -> tuple[str, str]: | |||
| 177 | # A negative return code is a host-signal termination (e.g. SIGSEGV), not a process exit code: | 186 | # A negative return code is a host-signal termination (e.g. SIGSEGV), not a process exit code: |
| 178 | # report it as a failure before SKIP_RETURN_CODE or WILL_FAIL can reinterpret it. | 187 | # report it as a failure before SKIP_RETURN_CODE or WILL_FAIL can reinterpret it. |
| 179 | return "fail", f"killed by signal {-code} in {elapsed:.1f} s\n{out}" | 188 | return "fail", f"killed by signal {-code} in {elapsed:.1f} s\n{out}" |
| 180 | skip_code = props.get("SKIP_RETURN_CODE") | 189 | if code == skip_code: |
| 181 | if skip_code is not None and code == int(skip_code): | ||
| 182 | return "skip", f"exit {code} (skip) in {elapsed:.1f} s\n{out}" | 190 | return "skip", f"exit {code} (skip) in {elapsed:.1f} s\n{out}" |
| 183 | detail = f"exit {code} in {elapsed:.1f} s\n{out}" | 191 | detail = f"exit {code} in {elapsed:.1f} s\n{out}" |
| 184 | skip_patterns = regex_list(props.get("SKIP_REGULAR_EXPRESSION", [])) | 192 | skip_patterns = regex_list(props.get("SKIP_REGULAR_EXPRESSION", [])) |