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
  1. Build your tests with debug symbols (PDBs)
  2. Run tests under covdbg to produce .covdb
  3. Export to LCOV/GCOV for downstream tooling
  4. 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-license and 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

BenefitDescription
Catch regressionsFail builds when coverage drops
Track trendsMonitor coverage over time
Enforce standardsSet minimum coverage thresholds
Document qualityShow coverage badges in README

Best Practices

  1. Run on every PR – Get coverage feedback before merge
  2. Use consistent filters – Keep .covdbg.yaml in version control
  3. Store artifacts – Save .covdb and exports for debugging
  4. Fail on threshold – Set minimum coverage requirements

Platform-Specific Guides

See Also