Extract failed test names from test runner output.
(output: str)
| 92 | |
| 93 | |
| 94 | def extract_failed_tests(output: str) -> list[FailedTest]: |
| 95 | """Extract failed test names from test runner output.""" |
| 96 | import re |
| 97 | |
| 98 | failed: list[FailedTest] = [] |
| 99 | # Match lines like " test_name | unit | bash test test_name --cpp" |
| 100 | # from the FAILED TESTS SUMMARY table |
| 101 | for line in output.splitlines(): |
| 102 | m = re.match(r"^\s+(\S+)\s+\|\s+(unit|example)\s+\|", line) |
| 103 | if m: |
| 104 | failed.append(FailedTest(name=m.group(1), category=m.group(2))) |
| 105 | return failed |
| 106 | |
| 107 | |
| 108 | def report_failure(label: str, result: subprocess.CompletedProcess[str]) -> None: |
no test coverage detected