Skip to content

v2.3.0

Choose a tag to compare

@devgony devgony released this 03 Aug 04:21
· 12 commits to main since this release

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 MCDC records and reports MC/DC totals in CLI summaries.
  • Reads and validates MCF/MCH summary records without storing redundant counters in snapshots.
  • Follows upstream LCOV semantics: MCF counts condition senses and MCH counts senses demonstrated by an independence pair.
  • Excludes official U<group-size> unreachable outcomes from default totals while accepting summaries produced with LCOV's ignore_unreachable_flag behavior.
  • 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.json

The 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 MCDC records 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 TN records 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: mcdc and test_names remain additive fields and no schema-version bump is required.

Upgrade notes

  • Existing LCOV-only workflows continue to work unchanged.
  • llvm-cov-json is optional; omit it when the producer already emits standard MCDC records or when MC/DC is not required.
  • badgers@v2 now resolves to v2.3.0. Exact-version users can pin devgony/badgers@v2.3.0.

Full Changelog: v2.2.0...v2.3.0