Result from running Meson build and tests
| 22 | |
| 23 | @dataclass |
| 24 | class MesonTestResult: |
| 25 | """Result from running Meson build and tests""" |
| 26 | |
| 27 | success: bool |
| 28 | duration: float # Total duration in seconds |
| 29 | num_tests_run: int # Number of tests executed |
| 30 | num_tests_passed: int # Number of tests that passed |
| 31 | num_tests_failed: int # Number of tests that failed |
| 32 | compilation_skipped: bool = ( |
| 33 | False # True when result came from cache (no compilation) |
| 34 | ) |
| 35 | failed_test_names: list[str] = field(default_factory=list) |
| 36 | # Phase timing breakdown (seconds) - for detailed performance analysis |
| 37 | meson_setup_time: float = 0.0 |
| 38 | ninja_maintenance_time: float = 0.0 |
| 39 | compile_time: float = 0.0 |
| 40 | test_execution_time: float = 0.0 |
| 41 | # Compilation sub-phase breakdown (seconds) |
| 42 | compile_core_time: float = 0.0 # Core libs + PCH + fastled.dll |
| 43 | compile_objects_time: float = 0.0 # .cpp object compilation |
| 44 | compile_example_link_time: float = 0.0 # Example DLL linking |
| 45 | compile_test_link_time: float = 0.0 # Test DLL linking |
| 46 | |
| 47 | @staticmethod |
| 48 | def construct_build_error(duration: float) -> "MesonTestResult": |
| 49 | """Construct MesonTestResult with error status and duration""" |
| 50 | out = MesonTestResult( |
| 51 | success=False, |
| 52 | duration=duration, |
| 53 | num_tests_run=0, |
| 54 | num_tests_passed=0, |
| 55 | num_tests_failed=0, |
| 56 | ) |
| 57 | return out |
| 58 | |
| 59 | |
| 60 | def run_meson_test( |
no outgoing calls