fix(runtest.py): A workaround to bypass errors that occur when deleting temporary files (#4093)

- Replace sys.exit with exceptions for better error handling in test assertions
- Update exception handling in compile_wast_to_wasm to catch all exceptions
- Improve error messages and logging
- Use `--ignore-whitespace` option for git apply in spec_test function
- Use raw string notation for regex patterns.  *The "SyntaxWarning: invalid escape sequence" in Python The warning has been upgraded to SyntaxWarning since Python 3.12, and it is expected to become a SyntaxError in future versions.*
- Add early return for non-loadable AOT compilation to prevent unnecessary assertions
- Redirect stderr to stdout in test_case for unified output
- Update `create_tmpfiles()`  to improve clarity and handling of temporary files
This commit is contained in:
liang.he
2025-03-20 14:25:13 +08:00
committed by GitHub
parent 1f14f4ec0a
commit 06ea960e76
5 changed files with 191 additions and 151 deletions

View File

@ -247,7 +247,7 @@ def test_case(
CMD,
bufsize=1,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
stderr=subprocess.STDOUT,
universal_newlines=True,
) as p:
try:
@ -285,7 +285,9 @@ def test_case(
except subprocess.TimeoutExpired:
print("failed with TimeoutExpired")
raise Exception(case_name)
except Exception as e:
print(f"An unexpected error occurred: {e}")
raise e
def test_suite(
target,