CI/CD Automation
Integrate code coverage into your continuous integration pipeline to catch regressions and track coverage trends.
Typical CI Workflow
Build Tests → Run covdbg → Export LCOV → Upload/Store Artifacts
- Build your tests with debug symbols (PDBs)
- Run tests under covdbg to produce
.covdb - Export to LCOV/GCOV for downstream tooling
- Upload to coverage services or store as artifacts
Quick Example
# 1. Run tests with coverage
covdbg --output coverage.covdb tests.exe
# 2. Export to LCOV
covdbg convert -i coverage.covdb -f LCOV -o coverage.lcov
# 3. Upload to coverage service (example)
codecov --file coverage.lcovCode language: PowerShell (powershell)
Environment Setup
Set your license via environment variable (recommended for CI):
$env:COVDBG_LICENSE = "<your-jwt-token>"Code language: PowerShell (powershell)
For secrets management, store COVDBG_LICENSE as an encrypted secret in your CI system.
Open Source? No license required. Just use
--fetch-licenseand covdbg will provision one automatically. See Open Source for details.
Silent Mode for Clean Output
Use --log-level NONE to suppress covdbg output and show only your test results:
covdbg --log-level NONE --output coverage.covdb tests.exeCode language: PowerShell (powershell)
Merging Multiple Test Runs
If you have multiple test executables or parallel test jobs:
# Run each test suite
covdbg --output unit.covdb unit_tests.exe
covdbg --output integration.covdb integration_tests.exe
# Merge results
covdbg merge -i unit.covdb -i integration.covdb -o merged.covdb
# Export merged coverage
covdbg convert -i merged.covdb -f LCOV -o coverage.lcovCode language: PowerShell (powershell)
Why Automate Coverage
| Benefit | Description |
|---|---|
| Catch regressions | Fail builds when coverage drops |
| Track trends | Monitor coverage over time |
| Enforce standards | Set minimum coverage thresholds |
| Document quality | Show coverage badges in README |
Best Practices
- Run on every PR – Get coverage feedback before merge
- Use consistent filters – Keep
.covdbg.yamlin version control - Store artifacts – Save
.covdband exports for debugging - Fail on threshold – Set minimum coverage requirements
Platform-Specific Guides
- GitHub Actions – Complete workflow examples
See Also
- CLI Reference – Command documentation
- Configuration – Filter setup
- Report Formats – Export formats