Skip to content

Commit

Permalink
fix: exit after print message
Browse files Browse the repository at this point in the history
  • Loading branch information
Zxilly committed Nov 22, 2024
1 parent fd2627e commit b70c42a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)}.")
Expand Down

0 comments on commit b70c42a

Please sign in to comment.