Skip to content

Bumped gcovr off the 4.1 pin it had been held on since 2018 - #663

Merged
fdesbiens merged 1 commit into
eclipse-threadx:devfrom
fdesbiens:chore/bump-gcovr
Aug 25, 2026
Merged

Bumped gcovr off the 4.1 pin it had been held on since 2018#663
fdesbiens merged 1 commit into
eclipse-threadx:devfrom
fdesbiens:chore/bump-gcovr

Conversation

@fdesbiens

Copy link
Copy Markdown
Contributor

scripts/install.sh pinned gcovr==4.1, released in 2018. That version has neither --json nor --add-tracefile, which is exactly how the five build configurations would be merged into a single coverage report — so the pin is a prerequisite for the rest of the coverage work, not just staleness.

This moves it to 8.6, the current release. The pin stays exact, so a coverage percentage remains comparable between runs, and it stays hand-moved: it lives in a shell script that no Dependabot ecosystem can parse. The new comment in install.sh says so, since #662 might otherwise imply this is now automated.

Nothing else is in this pull request on purpose — the number movement it might cause should not be confused with one caused by a later change.

It moves no number

Measured on the default_build_coverage tree of test/tx, over the same .gcda with the same gcov, varying only the gcovr version:

gcovr lines-valid branches-valid files
4.1 3827 1994 177
7.0 3827 1994 177
8.3 3827 1994 177
8.6 3827 1994 177

The denominator does not move with the tool. The plan behind this work expected 3822 → 3827 across the bump; that figure does not reproduce — not under gcc-13, not under gcc-14, and not with --object-directory dropped. The only variant that changes the count is dropping the -f ../../../common/src filter, which collapses the report to zero files.

Two findings worth more than the bump

The coverage numerator is not deterministic. On an identical tree with an identical compiler, three consecutive runs of the full suite — all 96 tests passing every time — reported:

run lines branches uncovered
1 3826/3827 1992/1994 tx_thread_system_resume.c:529
2 3827/3827 1993/1994 none
3 3827/3827 1993/1994 none

That line is _tx_thread_system_return(); — the "preemption is needed, return to the system" path of _tx_thread_system_resume — and it takes its guarding branch with it. It has been characterised as never executed by the suite. It is executed on some runs and not others. Two consequences: a coverage floor set at the observed maximum would flake, and the real fix is a test that takes that path deliberately rather than by timing.

--xml-pretty and --object-directory still work on 8.6, but only as deprecated aliases for --cobertura-pretty and --gcov-object-directory. Nothing to change here — worth knowing for whoever removes --object-directory, which measurably does nothing anyway.

Verification

Reading gcc-13 output — the compiler the runners actually use, since install.sh installs plain gcc and nothing sets CC — gcovr 8.6 runs the existing test/tx/cmake/coverage.sh unchanged end to end: Cobertura XML plus 181 HTML files, same 177 classes, exit 0. 96/96 tests passed.

Assisted-by: Claude Opus 5 noreply@anthropic.com

The coverage tooling was pinned to gcovr 4.1, released in 2018, and that
version is missing the two options the coverage work needs next: --json and
--add-tracefile, which is how the five build configurations get merged into
one report. This moves the pin to 8.6, the current release. The pin stays
exact, and it stays hand-moved: it lives in a shell script, and no Dependabot
ecosystem can parse that.

Isolated deliberately, so that a movement in the coverage number caused by the
tool could not be confused with one caused by a later change. Measured on the
default_build_coverage tree of test/tx, over the same gcda with the same gcov,
varying only the gcovr version:

  gcovr    lines-valid  branches-valid  files
  4.1      3827         1994            177
  7.0      3827         1994            177
  8.3      3827         1994            177
  8.6      3827         1994            177

So the denominator does not move with the tool at all, and this bump moves no
number. The plan this came from expected 3822 to become 3827; that figure does
not reproduce, under gcc-13 or gcc-14, with or without --object-directory. The
only variant that changes the count is dropping the -f filter, which collapses
the report to nothing.

Two things found while measuring, both recorded because they matter to what
comes next.

The coverage numerator is not deterministic. On an identical tree with an
identical compiler, three consecutive runs of the full suite -- all 96 tests
passing every time -- reported 3826, 3827 and 3827 covered lines. The line that
flickers is tx_thread_system_resume.c:529, the preemption path of
_tx_thread_system_resume, and it takes its guarding branch with it. It has been
described as never executed; it is executed on some runs and not others. A
coverage floor has to be set with that in mind, and the honest fix is a test
that takes the path deliberately.

Reading gcc-13 output, the compiler the runners actually use, gcovr 8.6 runs
the existing coverage.sh unchanged: Cobertura XML and 181 HTML files, same 177
classes. --xml-pretty and --object-directory still work on 8.6 but are now
deprecated aliases for --cobertura-pretty and --gcov-object-directory, worth
knowing for whoever removes --object-directory next.

Assisted-by: Claude Opus 5 <noreply@anthropic.com>
@fdesbiens
fdesbiens merged commit 2d9b9f7 into eclipse-threadx:dev Aug 25, 2026
8 checks passed
@fdesbiens
fdesbiens deleted the chore/bump-gcovr branch August 25, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant