77 lines
1.7 KiB
Python
Executable File
77 lines
1.7 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
import sys
|
|
import subprocess
|
|
from pathlib import Path
|
|
|
|
|
|
def run_test_file(test_file):
|
|
"""Run a single test file and return exit code"""
|
|
result = subprocess.run(
|
|
[sys.executable, str(test_file)],
|
|
cwd=Path.cwd()
|
|
)
|
|
return result.returncode
|
|
|
|
|
|
def main():
|
|
test_dir = Path("/home/dave/superdave/integration_tests")
|
|
|
|
# Find all test_*.py files
|
|
test_files = sorted(test_dir.glob("test_*.py"))
|
|
|
|
if not test_files:
|
|
print("Error: No test files found")
|
|
return 1
|
|
|
|
print("=" * 70)
|
|
print("GLYPHRUNNER INTEGRATION TEST SUITE")
|
|
print("=" * 70)
|
|
print()
|
|
|
|
results = {}
|
|
|
|
for test_file in test_files:
|
|
print(f"\n{'=' * 70}")
|
|
print(f"Running: {test_file.name}")
|
|
print(f"{'=' * 70}")
|
|
print()
|
|
|
|
exit_code = run_test_file(test_file)
|
|
results[test_file.name] = exit_code
|
|
|
|
if exit_code != 0:
|
|
print(f"\n❌ {test_file.name} FAILED")
|
|
else:
|
|
print(f"\n✓ {test_file.name} PASSED")
|
|
|
|
# Summary
|
|
print()
|
|
print("=" * 70)
|
|
print("SUMMARY")
|
|
print("=" * 70)
|
|
print()
|
|
|
|
passed = sum(1 for code in results.values() if code == 0)
|
|
failed = sum(1 for code in results.values() if code != 0)
|
|
total = len(results)
|
|
|
|
for name, code in results.items():
|
|
status = "✓ PASS" if code == 0 else "❌ FAIL"
|
|
print(f" {status}: {name}")
|
|
|
|
print()
|
|
print(f"Total: {total} test suites, {passed} passed, {failed} failed")
|
|
|
|
if failed == 0:
|
|
print()
|
|
print("🎉 ALL TESTS PASSED 🎉")
|
|
return 0
|
|
else:
|
|
print()
|
|
print(f"⚠️ {failed} test suite(s) failed")
|
|
return 1
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|