diff options
| author | Frédéric Desbiens <[email protected]> | 2026-08-25 17:16:51 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-08-25 17:16:51 -0400 |
| commit | b756220c434f1ca49495020cb1c001c8910b2179 (patch) | |
| tree | 9e2fe39519a8dd72845bd772db4b4d09e6d3cf49 /common_modules/module_manager/utilities/module_binary_to_c_array.c | |
| parent | 2d9b9f74171234c0b5e0982042dd24c7e24e1387 (diff) | |
Fixed the coverage report's paths and scoping (#664)
The Cobertura XML embedded absolute machine paths, and the flag that looked
like it scoped the report to one build configuration was doing nothing at all.
Both coverage.sh scripts had the defect; both are fixed here, because the SMP
report is published to the same Pages site as the ThreadX one.
Paths. -r was the build directory and -f pointed outside it, so gcovr could not
express the sources relative to the root and fell back to absolute paths. The
result named files as /home/runner/work/threadx/threadx/common/src/... while
the <source> element beside them said build/default_build_coverage, so the two
halves of the same file disagreed and nothing could map coverage back to the
repository. -r is the repository root now and -f an absolute path beneath it,
which gives filename="common/src/tx_block_allocate.c".
Both must be absolute: -r ../../.. -f common/src produces a report of zero
files and exits 0, which is the worst failure mode available here.
Scoping. --object-directory does not restrict which gcda files are found -- it
tells gcovr how to get from a gcda file back to the compiler's working
directory. Pointed at an empty directory it still produced the full 177-file
report. That was harmless only by accident, because -r build/$1 constrained the
search instead; moving -r to the repository root removes that accident, so the
two changes have to land together. Measured, with a second instrumented
configuration deliberately made sparser than the first:
scoped by the positional search path 3221 of 3827 lines -- the truth
no search path, -r at the repo root 3827 of 3827 -- silently merged
--object-directory at the sparse tree 3827 of 3827 -- scopes nothing
So the search path is load-bearing, and it matters ahead of instrumenting all
five configurations: without it each configuration would have reported the
union as its own.
An empty report is not an error to gcovr -- it warns and exits 0 -- and it
carries line-rate="1.0" next to lines-valid="0", so a consumer reads no data at
all as fully covered. No coverage threshold can catch that, since an empty
report passes any threshold. Hence the explicit assertion that the report has
content, which fires with exit 1 on an object directory that exists but is
empty, where the old shape returned 177 files and exit 0.
Also says out loud that ports/linux/gnu/src is deliberately outside the filter.
gcno files exist for it and it is dropped without a word today.
Number-neutral, and that was the test. Over the same frozen gcda, changing only
the gcovr invocation: ThreadX 3827 of 3827 lines and 1993 of 1994 branches
across 177 files, SMP 4739 of 4791 and 2417 of 2430 across 185, before and
after alike. Same answers on gcovr 7.0, 8.3 and 8.6, so the change is not
wedged to the current pin. End to end through run.sh, 96 of 96 and 110 of 110
pass with the reports written.
Assisted-by: Claude Opus 5 <[email protected]>
Diffstat (limited to 'common_modules/module_manager/utilities/module_binary_to_c_array.c')
0 files changed, 0 insertions, 0 deletions
