v2.3.0
Highlights
Badgers v2.3.0 adds end-to-end MC/DC ingestion for both GCC/LCOV and LLVM-based coverage pipelines while preserving the generic LCOV contract. It also records LCOV test names and improves HTML branch visibility.
MC/DC coverage from LCOV
- Parses standard
MCDCrecords and reports MC/DC totals in CLI summaries. - Reads and validates
MCF/MCHsummary records without storing redundant counters in snapshots. - Follows upstream LCOV semantics:
MCFcounts condition senses andMCHcounts senses demonstrated by an independence pair. - Excludes official
U<group-size>unreachable outcomes from default totals while accepting summaries produced with LCOV'signore_unreachable_flagbehavior. - Keeps malformed optional MC/DC records and summary mismatches non-fatal, consistent with existing branch/function summary validation.
- Verified against real GCC 14.4 + LCOV 2.5 output (
MCF:12,MCH:10).
LLVM MC/DC JSON sidecar
LLVM calculates MC/DC but does not emit MCDC, MCF, or MCH records from llvm-cov export -format=lcov. v2.3.0 bridges that gap with an optional JSON sidecar:
- uses: devgony/badgers@v2
with:
coverage-command: |
llvm-cov export ./target -instr-profile=cov.profdata -format=lcov > coverage/lcov.info
llvm-cov export ./target -instr-profile=cov.profdata -format=text > coverage/llvm-cov.json
lcov-file: coverage/lcov.info
llvm-cov-json: coverage/llvm-cov.jsonThe same input is applied when Badgers rebuilds a merge-base baseline.
Safety and compatibility behavior:
- Supports llvm-cov JSON schema 2.x (LLVM 18–20) and 3.x (LLVM 21+).
- Uses file-level records only, avoiding duplicate function-level records.
- Validates JSON document type, schema, record kind, source paths, and LCOV line totals.
- Skips a file rather than publishing incorrect MC/DC totals when detailed conditions disagree with llvm-cov's summary, including folded constant conditions that the JSON does not identify explicitly.
- Rejects mixing GCC sense-based
MCDCrecords with LLVM condition-based sidecar records in one snapshot. - Unknown future schema majors are skipped with a warning rather than parsed heuristically.
- Verified with a real LLVM 20.1.8 export and fixtures for schema 2.x and 3.x layouts.
The sidecar is currently most useful for Clang C/C++ coverage. Rust's unstable MC/DC instrumentation has been removed from current nightly toolchains.
Test-name and report improvements
- Parses
TNrecords and attributes sorted, deduplicated test names to covered files. - Adds MC/DC totals to terminal collection summaries.
- Adds a conditional branch-coverage column to HTML file listings when branch data is available.
- Keeps snapshots backward compatible:
mcdcandtest_namesremain additive fields and no schema-version bump is required.
Upgrade notes
- Existing LCOV-only workflows continue to work unchanged.
llvm-cov-jsonis optional; omit it when the producer already emits standardMCDCrecords or when MC/DC is not required.badgers@v2now resolves to v2.3.0. Exact-version users can pindevgony/badgers@v2.3.0.
Full Changelog: v2.2.0...v2.3.0