Find the functions the coverage report leaves out of its 100% #8

Open
opened 2026-11-22 13:22:55 +00:00 by jorijnvdgraaf · 0 comments

tests/coverage.sh ends on lines, functions and regions at 100.00%, and the guide and commit messages quote that. The same report prints, before and after its table:

warning: 57 functions have mismatched data

llvm-cov drops a function's record when its profile does not match its coverage mapping. So the 100% is of what was counted, and 57 records are in neither the covered nor the missed column. Whether the same functions are counted through another executable's record is part of what is not known.

Found by the pre-push review of 1.0.0 (the commit-truth lens), reading the captured report. It is not that release's doing: at the commit before it (564fcdf) the report says 58, and at the release's own change (b43ab12) 57. Whether it was there on 2026-11-19, when the guide records the 100%, was not checked.

Where

tests/coverage.sh merges every process's profile into one (llvm-profdata merge -sparse) and reports over all the test executables at once (llvm-cov report, then llvm-cov show). The script checks that no source of the toolkit and the app is missing from the report, and prints every line no test ran. It does not look at the warning.

What is not known

Which functions they are, and why they mismatch. A function has one name and two hashes when the same source is compiled into two executables in two shapes. Candidates here, none of them checked: what tests/Support/*.inc defines, included into several tests with different things in scope; implementations/main.cpp and nostrod.cpp, compiled into tests with main renamed; inline functions and templates of the module interfaces, instantiated per test.

What it would take

  • Find the 57. llvm-cov has a debug dump (-dump) that should name each record it found no profile for; that was not tried.
  • If they are functions of the tests' own support code, leave those sources out of the report, or say in the guide that they are not counted. If they are functions of the library, nostrod, the toolkit or the app, the 100% leaves out product code, and the report needs to count them: one report per executable, or the cause taken away.
  • Have the script fail on the warning once the number is zero, so that it stays so.
  • Until then the guide's "every line, function and region" ("Build, test and style commands", "Testing instructions") wants the caveat.

What was run, and what was read

Run: tests/coverage.sh with the host's profile runtime (clang 23's libclang_rt.profile.a). At b43ab12, whose code is that of 8dd31e2 but for the version, the totals are 5143 regions, 1040 functions and 9561 lines at 100.00%, branches at 95.70%, and the warning says 57. At 564fcdf, the commit before the release's range: 5040 regions, 1055 functions and 9615 lines at 100.00%, branches at 95.72%, and the warning says 58. Nothing beyond that: no list of the functions was made.

`tests/coverage.sh` ends on lines, functions and regions at 100.00%, and the guide and commit messages quote that. The same report prints, before and after its table: ``` warning: 57 functions have mismatched data ``` llvm-cov drops a function's record when its profile does not match its coverage mapping. So the 100% is of what was counted, and 57 records are in neither the covered nor the missed column. Whether the same functions are counted through another executable's record is part of what is not known. Found by the pre-push review of 1.0.0 (the commit-truth lens), reading the captured report. It is not that release's doing: at the commit before it (564fcdf) the report says 58, and at the release's own change (b43ab12) 57. Whether it was there on 2026-11-19, when the guide records the 100%, was not checked. ## Where [`tests/coverage.sh`](https://forgejo.catcrafts.net/Catcrafts/Nostro/src/commit/8dd31e2bb9eb3ac3f7c73ea5f35ad1986b61877b/tests/coverage.sh#L20-L42) merges every process's profile into one (`llvm-profdata merge -sparse`) and reports over all the test executables at once (`llvm-cov report`, then `llvm-cov show`). The script checks that no source of the toolkit and the app is missing from the report, and prints every line no test ran. It does not look at the warning. ## What is not known Which functions they are, and why they mismatch. A function has one name and two hashes when the same source is compiled into two executables in two shapes. Candidates here, none of them checked: what `tests/Support/*.inc` defines, included into several tests with different things in scope; `implementations/main.cpp` and `nostrod.cpp`, compiled into tests with `main` renamed; inline functions and templates of the module interfaces, instantiated per test. ## What it would take - Find the 57. llvm-cov has a debug dump (`-dump`) that should name each record it found no profile for; that was not tried. - If they are functions of the tests' own support code, leave those sources out of the report, or say in the guide that they are not counted. If they are functions of the library, nostrod, the toolkit or the app, the 100% leaves out product code, and the report needs to count them: one report per executable, or the cause taken away. - Have the script fail on the warning once the number is zero, so that it stays so. - Until then the guide's "every line, function and region" ("Build, test and style commands", "Testing instructions") wants the caveat. ## What was run, and what was read Run: `tests/coverage.sh` with the host's profile runtime (clang 23's `libclang_rt.profile.a`). At b43ab12, whose code is that of 8dd31e2 but for the version, the totals are 5143 regions, 1040 functions and 9561 lines at 100.00%, branches at 95.70%, and the warning says 57. At 564fcdf, the commit before the release's range: 5040 regions, 1055 functions and 9615 lines at 100.00%, branches at 95.72%, and the warning says 58. Nothing beyond that: no list of the functions was made.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Catcrafts/Nostro#8
No description provided.