Skip to content

Branch coverage is around 78% in both suites and is enforced by nothing, because fail_below_min compares the line rate only #684

Description

@fdesbiens

AGENTS.md asks for 100% test coverage. After #666 and #677 the line coverage is essentially there:

suite lines line rate branches branch rate
ThreadX (common/src) 4502 / 4503 99.98% 2556 / 3292 77.6%
SMP (common_smp/src) 5167 / 5178 99.79% 2829 / 3560 79.5%

About 1470 branches are uncovered across the two suites, and nobody has looked at any of them.

This has stayed invisible for a structural reason rather than an oversight: irongut/CodeCoverageSummary's fail_below_min compares the line rate only. The branch rate is printed in the summary and enforced by nothing, so the coverage floors added in #667 and #677 cannot see it.

For a project resting a certification argument on structural coverage of common/src, a line rate of 99.8% beside a branch rate of 78% is not the claim it appears to be.

Settle the denominator before setting any floor

Measured 28 Aug 2026 on #677's run and on a local run of the same tree with the same gcovr:

line denominator branch denominator
CI runner 5178 3560
local 5178 3548

lines-valid agrees exactly. branches-valid does not, and twelve branches is more than enough to make a threshold fail for reasons unrelated to the change under test. Why the branch denominator moves between machines has to be understood before any branch floor is set, or the floor becomes a source of spurious red runs — which is how the coverage gate loses its credibility.

The line denominator has been stable across gcovr versions and runs alike, so this is specific to branches.

Suggested order

  1. Find out why branches-valid differs between the runner and a local run. Compiler version is the first suspect; the runner uses the distro gcc for the Linux port build.
  2. Once it is stable, take a census of the uncovered branches by file, the way Covered the trace entry update paths and the misaligned stack adjustment #666 and Covered the SMP suspension teardown and the long byte pool search #677 did for lines. The expectation from those two is that a large fraction will turn out to be a handful of missing scenarios rather than hundreds of separate gaps.
  3. Only then consider enforcing anything, and note that fail_below_min cannot do it — enforcing a branch floor needs a different mechanism.

Follows from #666, #667 and #677.

Metadata

Metadata

Assignees

Labels

featureNew feature or enhancement request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions