"""Run all test suites under coverage measurement""" import subprocess, sys, glob tests = [ "test-data/round2_remaining_tests.py", "test-data/round3_deep_coverage.py", "test-data/r4_deep_coverage.py", "test-data/r4_design_coverage.py", "test-data/r4_cond_coverage.py", "test-data/r4_coverage_coverage.py", "test-data/r5_integration_coverage.py", "test-data/r6_deep_coverage.py", "test-data/r7_final_deep.py", "test-data/r8_env_coverage.py", "test-data/r9_deep_coverage.py", "test-data/r10_pipeline_agent.py", "test-data/r11_real_verification.py", "test-data/r12_real_cobol_pipeline.py", "test-data/r12b_orchestrator_e2e.py", "test-data/r13_final_sweep.py", ] for t in tests: r = subprocess.run( [sys.executable, "-m", "coverage", "run", "--append", "--parallel-mode", "-p", t], capture_output=True, text=True, timeout=300 ) if r.returncode != 0: print(f"FAIL {t}: {r.stderr[:100]}") else: print(f"OK {t}") # Combine data files subprocess.run([sys.executable, "-m", "coverage", "combine"], capture_output=True) print("\nCoverage data combined. Generating report...") # Generate report r = subprocess.run( [sys.executable, "-m", "coverage", "report", "--show-missing", "--omit=test-data/*,__pycache__/*,tests/*"], capture_output=True, text=True, timeout=60 ) print(r.stdout[-2000:] if len(r.stdout) > 2000 else r.stdout) if r.stderr: print("STDERR:", r.stderr[:500]) # Generate HTML subprocess.run( [sys.executable, "-m", "coverage", "html", "--omit=test-data/*,__pycache__/*,tests/*", "-d", "coverage_report"], capture_output=True, text=True, timeout=60 ) print("HTML report: coverage_report/index.html")