Codecov.io integration is fully working. Coverage data is uploaded in Codecov's native JSON format with line-level detail.
Dashboard: https://app.codecov.io/gh/bero/BoldForDelphi
# Set token (once per session)
$env:CODECOV_TOKEN = "your-token-here"
# Run tests with coverage and upload (from repo root)
powershell -ExecutionPolicy Bypass -File "UnitTest\run_coverage.ps1" -Upload| Flag | Description |
|---|---|
-SkipBuild |
Skip compilation, use existing UnitTest.exe |
-OpenReport |
Open HTML report in browser after completion |
-Upload |
Upload coverage to Codecov.io (requires CODECOV_TOKEN) |
| File | Purpose |
|---|---|
UnitTest/Convert-ToCodecovJson.ps1 |
Parses HTML coverage reports to Codecov JSON format |
UnitTest/codecov.json |
Output file for Codecov upload (gitignored) |
UnitTest/codecov.exe |
Codecov uploader (downloaded automatically, gitignored) |
Run_coverage.ps1
|
v
+---------------------+
| Build UnitTest.exe |
| with MAP file |
+----------+----------+
|
v
+---------------------+
| DelphiCodeCoverage |
| runs tests |
+----------+----------+
|
v
+---------------------+ +-------------------------+
| HTML coverage |---->| Convert-ToCodecovJson |
| reports (per file) | | .ps1 |
+---------------------+ +------------+------------+
|
v
+-------------------------+
| codecov.json |
| (line-level coverage) |
+------------+------------+
|
v
+-------------------------+
| codecov.exe upload |
+------------+------------+
|
v
+-------------------------+
| Codecov.io |
| - Dashboard |
| - Trend graphs |
| - PR comments |
| - Badge |
+-------------------------+
- Never commit the token to git
- Use environment variable
CODECOV_TOKEN - For GitHub Actions, use repository secrets
The Codecov JSON format requires line-level data. The converter parses HTML reports which contain this detail. If you see this error:
- Ensure coverage HTML reports exist in
UnitTest/coverage_report/ - Check that source files in the report match paths in the git repository
The converter uses proper number formatting regardless of system locale.