mirror of
https://github.com/p-e-w/heretic.git
synced 2026-09-01 09:56:07 -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
|
||||
|
||||
# For tracking failures as (test_name, [failed_files]) and successful runs.
|
||||
failed_tests: list[tuple[str, list[str]]] = []
|
||||
passed_tests: list[str] = []
|
||||
tests_failed = False
|
||||
|
||||
for test_directory in script_directory.iterdir():
|
||||
if test_directory.is_dir():
|
||||
@@ -67,8 +65,6 @@ for test_directory in script_directory.iterdir():
|
||||
|
||||
valid_hashes[filename].append(sha256.lower())
|
||||
|
||||
# Track which specific files failed within this test directory.
|
||||
failed_files: list[str] = []
|
||||
for filename in valid_hashes:
|
||||
sha256 = get_file_sha256(test_directory / "model" / filename)
|
||||
|
||||
@@ -83,20 +79,9 @@ for test_directory in script_directory.iterdir():
|
||||
f"{sha256}\n"
|
||||
)
|
||||
)
|
||||
failed_files.append(filename)
|
||||
tests_failed = True
|
||||
|
||||
if failed_files:
|
||||
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)
|
||||
if tests_failed:
|
||||
sys.exit("Tests failed.")
|
||||
else:
|
||||
print("All tests passed.")
|
||||
|
||||
Reference in New Issue
Block a user