<feed xmlns='http://www.w3.org/2005/Atom'>
<title>threadx.git/test/tx/cmake/coverage_union.py, branch v6.4.1_cert</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/threadx.git/atom/test/tx/cmake/coverage_union.py?h=v6.4.1_cert</id>
<link rel='self' href='http://cgit.235523.xyz/threadx.git/atom/test/tx/cmake/coverage_union.py?h=v6.4.1_cert'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/threadx.git/'/>
<updated>2026-09-23T11:39:47Z</updated>
<entry>
<title>Excluded the regression-test hook code from the coverage denominator</title>
<updated>2026-09-23T11:39:47Z</updated>
<author>
<name>Frédéric Desbiens</name>
<email>frederic.desbiens@eclipse-foundation.org</email>
</author>
<published>2026-09-23T11:39:47Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/threadx.git/commit/?id=fe746ee931d53c7d4cf0a1621879951bcb685530'/>
<id>urn:sha1:fe746ee931d53c7d4cf0a1621879951bcb685530</id>
<content type='text'>
The test build defines TX_REGRESSION_TEST for every configuration, which opens
a block in the Linux port header defining eight *_EXTENSION macros. They expand
to live code -- flag tests, state changes and calls -- at eight sites in
common/src, and an application defines none of them and compiles none of it.
gcov attributes a macro expansion to the file that invokes it, so the harness's
own scaffolding was being counted as certified source.

coverage_union.py now drops those expansions and prints what it dropped beside
the configurations it merged, so the exclusion is auditable, and a site that no
longer matches the report fails the run rather than being skipped.
tx_timer_initialize.c:275 keeps its line and loses only its branches: it is the
one macro whose tx_api.h fallback is not empty, so under TX_MISRA_ENABLE that
line still carries a statement in a build that ships.
gcovr's merged report is not touched.

The hook code is 8 lines and 22 branch outcomes, all covered, 0.183% of lines
and 0.694% of outcomes. The union goes from 4383/4383 and 3150/3170 to
4376/4376 and 3128/3148: line coverage stays at 100.00%, and the branch rate
falls from 99.36909% to 99.364676%, since removing an all-covered block from a
figure below 100% moves it down. Both thresholds are unchanged and both pass,
the branch one by 0.15 of an outcome. Seven configurations from a wiped tree,
115/115 tests in each, and the twenty uncovered outcomes are the same twenty at
the same sixteen sites.

Assisted-by: Claude Code (Opus 5) &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>Reported coverage of the source rather than of the compiled configurations</title>
<updated>2026-09-16T02:42:53Z</updated>
<author>
<name>Frédéric Desbiens</name>
<email>frederic.desbiens@eclipse-foundation.org</email>
</author>
<published>2026-09-16T02:42:53Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/threadx.git/commit/?id=e20655f0def4944057b05fc474f7f1e0c45f10ed'/>
<id>urn:sha1:e20655f0def4944057b05fc474f7f1e0c45f10ed</id>
<content type='text'>
The merged report's branch denominator is not the number of branches in
common/src. gcovr keys each branch by the basic-block pair gcov assigned it, and
those numbers shift when a file compiles to a different amount of code, so a
source branch that survives block renumbering between two configurations is
counted twice. Measured over the six configurations: 521 of 1123 branch sites
carry more branches in the merged report than any single configuration has, and
the denominator reads 4627 where the source carries 3156. The inflation is
symmetric for a branch covered everywhere, so the percentage stays plausible and
the fault is easy to miss.

It is not harmless. A figure quoted as branch coverage of the source has to have
the source in its denominator, and this one moves when a build configuration is
added for reasons that have nothing to do with the code.

coverage_union.py reports the union instead: a line is covered if any
configuration executed it, and the Nth branch on a line is covered if any
configuration took it, keyed by position within the line rather than by block
number. gcovr's merged report is still produced and published unchanged; the
ratchet now gates on the union, so the floor tracks the source.

Both figures agree on what is uncovered: the same 28 branch outcomes in the same
14 files either way. Over the six configurations the union reads 4339/4339 lines
and 3128/3156 branches, against 4339/4339 and 4599/4627 merged, with the gates
set to 99.95 and 99.00.

Assisted-by: Claude Code (Opus 5) &lt;noreply@anthropic.com&gt;
</content>
</entry>
</feed>
