mirror of
https://github.com/p-e-w/heretic.git
synced 2026-09-02 18:36:32 -07:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3444a0dd67 | |||
| b796257c37 |
+3
-18
@@ -23,9 +23,7 @@ script_directory = Path(__file__).resolve().parent
|
|||||||
|
|
||||||
project_directory = script_directory.parent
|
project_directory = script_directory.parent
|
||||||
|
|
||||||
# For tracking failures as (test_name, [failed_files]) and successful runs.
|
tests_failed = False
|
||||||
failed_tests: list[tuple[str, list[str]]] = []
|
|
||||||
passed_tests: list[str] = []
|
|
||||||
|
|
||||||
for test_directory in script_directory.iterdir():
|
for test_directory in script_directory.iterdir():
|
||||||
if test_directory.is_dir():
|
if test_directory.is_dir():
|
||||||
@@ -67,8 +65,6 @@ for test_directory in script_directory.iterdir():
|
|||||||
|
|
||||||
valid_hashes[filename].append(sha256.lower())
|
valid_hashes[filename].append(sha256.lower())
|
||||||
|
|
||||||
# Track which specific files failed within this test directory.
|
|
||||||
failed_files: list[str] = []
|
|
||||||
for filename in valid_hashes:
|
for filename in valid_hashes:
|
||||||
sha256 = get_file_sha256(test_directory / "model" / filename)
|
sha256 = get_file_sha256(test_directory / "model" / filename)
|
||||||
|
|
||||||
@@ -83,20 +79,9 @@ for test_directory in script_directory.iterdir():
|
|||||||
f"{sha256}\n"
|
f"{sha256}\n"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
failed_files.append(filename)
|
tests_failed = True
|
||||||
|
|
||||||
if failed_files:
|
if tests_failed:
|
||||||
failed_tests.append((test_directory.name, failed_files))
|
|
||||||
else:
|
|
||||||
passed_tests.append(test_directory.name)
|
|
||||||
|
|
||||||
if failed_tests:
|
|
||||||
print("#" * 50)
|
|
||||||
print("Summary of test failures:")
|
|
||||||
for test_name, files in failed_tests:
|
|
||||||
files_str = ", ".join(files)
|
|
||||||
print(f"- {test_name} (failed files: {files_str})")
|
|
||||||
print("#" * 50)
|
|
||||||
sys.exit("Tests failed.")
|
sys.exit("Tests failed.")
|
||||||
else:
|
else:
|
||||||
print("All tests passed.")
|
print("All tests passed.")
|
||||||
|
|||||||
Reference in New Issue
Block a user