import re with open('test_output.log', 'r') as f: lines = f.readlines() current_package = None failures = {} for i, line in enumerate(lines): # Match package name if 'Running' in line and ('tests/' in line or 'src/lib.rs' in line or 'src/main.rs' in line): match = re.search(r'Running.*\(target/debug/deps/([^-]+)', line) if match: current_package = match.group(1) # Match test failures if 'test result: FAILED' in line: match = re.search(r'(\d+) passed; (\d+) failed', line) if match and current_package: passed = int(match.group(1)) failed = int(match.group(2)) if current_package not in failures: failures[current_package] = {'passed': 0, 'failed': 0} failures[current_package]['passed'] += passed failures[current_package]['failed'] += failed print("PACKAGES WITH TEST FAILURES:") print("=" * 80) for pkg, stats in sorted(failures.items()): total = stats['passed'] + stats['failed'] rate = stats['passed'] / total * 100 if total > 0 else 0 print(f"{pkg:40s} {stats['passed']:3d}/{total:3d} passed ({rate:5.1f}%)")