Skip to content

score/time: Migrate coverage pipeline to LLVM source-based coverage (linux) #147

Description

@lavrovvalera

What

Migrate the score/time coverage pipeline from GCC/gcov to LLVM source-based
coverage (llvm-cov) for Linux builds. Keep the gcov pipeline for QNX.

Deliverables:

  • quality/coverage/coverage.bazelrc — LLVM settings for Linux + gcov for QNX
  • quality/coverage/llvm_cov/merger.py — per-test profraw→profdata zip generator
  • quality/coverage/llvm_cov/reporter.py — final HTML + LCOV report generator
  • quality/coverage/llvm_cov/reporter_wrapper.bzl — Bazel wrapper
  • .bazelrc — imports quality/coverage/coverage.bazelrc
  • MODULE.bazel — exposes @llvm_toolchain_llvm for llvm-cxxfilt
  • .github/workflows/code-coverage.yml — custom workflow using new pipeline
  • New time-x86_64-linux-coverage config for coverage builds (no GCC platform pin)

Why

GCC/gcov instruments at assembly level and generates phantom branches for:

  • Exception-unwind edges on every non-noexcept call (affects ptp headers,
    std::make_shared in stub backends)
  • GMock internal bookkeeping branches (affects all mock files)
  • Assertion-abort branches that are only coverable via subprocess death tests

These phantom branches cause all mock files and ptp headers to show 50% branch
coverage permanently, making the 90% branch coverage goal of #47 unreachable
with gcov.

LLVM source-based coverage tracks source regions, not assembly branches:

  • ptp headers: 100% branch (was 50% with gcov) ✅
  • GMock mock files: 100% branch (was 50% with gcov) ✅
  • No phantom exception-unwind branches ✅
  • Baseline: 95.1% line, branch gaps only from untested code paths

References

Acceptance Criteria

  • bazel coverage --config=time-x86_64-linux-coverage //score/time/...
    completes without error
  • lcov_report/lcov.dat is present in the reporter output zip and
    parseable as LCOV text
  • CI workflow code-coverage.yml runs successfully on Linux x86_64
  • All mock files and ptp headers show ≥ 90% line and ≥ 90% branch
  • QNX coverage still works via --config=qnx with the gcov pipeline
  • enable_llvm_coverage_for_death_tests enabled once score_cpp_policies
    is updated to ≥ 0.0.2 (death-test subprocess coverage)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

Status
In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions