From 702b8e92880364860dd38593395c371628fc53cf Mon Sep 17 00:00:00 2001 From: Zxilly Date: Fri, 22 Nov 2024 05:44:07 +0800 Subject: [PATCH] fix: exit after print message --- scripts/tests.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/tests.py b/scripts/tests.py index d065d4b5f5..2e9202f232 100644 --- a/scripts/tests.py +++ b/scripts/tests.py @@ -33,11 +33,13 @@ def run_unit(name: str, env: dict[str, str], pargs: list[str], timeout: int): stderr=subprocess.STDOUT, timeout=timeout ) - stdout.check_returncode() with open(os.path.join(unit_output_dir, f"{name}.txt"), "w", encoding="utf-8") as f: f.write(stdout.stdout) + if stdout.returncode != 0: + raise Exception(f"Unit test {name} failed with return code {stdout.returncode}.") + generate_junit(stdout.stdout, os.path.join(get_project_root(), f"{name}.xml")) log(f"Unit test {name} passed in {format_time(time.time() - start)}.")