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.lcov

Environment Setup

A pipeline has nobody to sign in, so it carries a project token:

$env:COVDBG_PROJECT_TOKEN = "<your-project-token>"

Store COVDBG_PROJECT_TOKEN as an encrypted secret in your CI system.

Open Source? Public repositories are free; the pipeline still carries a project token, which is what names who is asking. See Open Source for details.

Clean Output

covdbg leaves the console to your test results and only adds its own errors there; its log goes to a file. Use --log-level NONE to switch the log file off:

covdbg --log-level NONE --output coverage.covdb tests.exe

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.lcov

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

  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

We store your theme and cookie choices to remember your preferences. With your permission, Google Analytics and our self-hosted Matomo help us understand how this website is used.

You can change your choice using Cookie settings in the footer. Cookie policy · Privacy policy