From c1f765332bdb2a31bfa8fb994b5f2a2f4a023a94 Mon Sep 17 00:00:00 2001 From: nocturn9x Date: Wed, 5 Jul 2023 14:43:15 +0200 Subject: [PATCH] Minor updates to test runner --- run_tests.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/run_tests.py b/run_tests.py index 86f6cab..3d46a9b 100644 --- a/run_tests.py +++ b/run_tests.py @@ -1,8 +1,9 @@ import sys -from tqdm import tqdm import shlex import subprocess from pathlib import Path +from tqdm import tqdm +from timeit import default_timer NIM_FLAGS = "-d:debug" PEON_FLAGS = "-n --showMismatches" @@ -15,6 +16,8 @@ def main() -> int: failed: set[Path] = set() # We consume the generator now because I want tqdm to show the progress bar! test_files = list((Path.cwd() / "tests").resolve(strict=True).glob("*.pn")) + print(f"Collected {len(test_files)} tests (before filtering)") + start = default_timer() for test_file in tqdm(test_files): tests.add(test_file) if test_file.name in EXCLUDE: @@ -29,9 +32,10 @@ def main() -> int: continue if not all(map(lambda s: s == b"true", out.stdout.splitlines())): failed.add(test_file) + time_taken = default_timer() - start total = len(tests) successful = len(tests - failed - skipped) - print(f"Collected {total} tests ({successful}/{total}) passed, {len(failed)}/{total} failed, {len(skipped)}/{total} skipped)") + print(f"Test suite ran in {time_taken:.2f} seconds ({successful}/{total}) passed, {len(failed)}/{total} failed, {len(skipped)}/{total} skipped)") return len(failed) == 0