mirror of
https://github.com/DebarghaG/proofofthought.git
synced 2025-10-07 23:24:54 +03:00
27 lines
585 B
Python
Executable File
27 lines
585 B
Python
Executable File
#!/usr/bin/env python3
|
|
"""Test runner script."""
|
|
|
|
import os
|
|
import sys
|
|
import unittest
|
|
|
|
# Add project root to path
|
|
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
|
|
def run_tests() -> int:
|
|
"""Discover and run all tests."""
|
|
loader = unittest.TestLoader()
|
|
start_dir = "tests"
|
|
suite = loader.discover(start_dir, pattern="test_*.py")
|
|
|
|
runner = unittest.TextTestRunner(verbosity=2)
|
|
result = runner.run(suite)
|
|
|
|
# Return exit code based on success
|
|
return 0 if result.wasSuccessful() else 1
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(run_tests())
|