Files
led-controller/tests/models/run_all.py
2026-03-21 20:17:33 +13:00

63 lines
1.6 KiB
Python

"""Run all model tests."""
import sys
import os
# Add src to path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../../src'))
from test_model import test_model
from test_preset import test_preset
from test_profile import test_profile
from test_group import test_group
from test_sequence import test_sequence
from test_tab import test_tab
from test_palette import test_palette
from test_device import test_device
def run_all_tests():
"""Run all model tests."""
print("=" * 60)
print("Running Model Tests")
print("=" * 60)
tests = [
("Base Model", test_model),
("Preset", test_preset),
("Profile", test_profile),
("Group", test_group),
("Sequence", test_sequence),
("Tab", test_tab),
("Palette", test_palette),
("Device", test_device),
]
passed = 0
failed = 0
for name, test_func in tests:
print(f"\n{'=' * 60}")
print(f"Testing {name}")
print('=' * 60)
try:
test_func()
print(f"\n{name} tests passed!")
passed += 1
except AssertionError as e:
print(f"\n{name} tests failed: {e}")
failed += 1
except Exception as e:
print(f"\n{name} tests error: {e}")
import traceback
traceback.print_exc()
failed += 1
print(f"\n{'=' * 60}")
print(f"Test Summary: {passed} passed, {failed} failed")
print('=' * 60)
return failed == 0
if __name__ == '__main__':
success = run_all_tests()
sys.exit(0 if success else 1)