You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Classify included headers without executable code as declaration-only, not no-data #43
unmapped_files.txt lists score/launch_manager/src/daemon/src/watchdog/details/Watchdog.hpp (lifecycle) as no-data, although WatchdogImpl_UT.cpp includes it and its tests run. The header holds only constexpr constants and includes, no function, so clang emits no coverage region for it and llvm-cov cannot list it. There is nothing to measure; the file belongs in the harmless declaration-only category.
Not a bug in the measurement: no coverage is lost. The category is wrong.
Why
select_files in reporter.py recognises declaration-only by a naming rule: a header without data whose same-stem source has data (foo.h next to a compiled foo.cpp). A header with no companion source, such as a constants-only or interface-only header, cannot be told apart from a header nothing includes, because a header without functions leaves no trace in the objects. It falls into no-data, the category that is meant to flag real gaps.
Proposal
Use the compiler's own knowledge of which headers were included:
With -MD/.d dependency files (Bazel's .d outputs of CppCompile actions) or the showIncludes-style data, the scope aspect can record the set of headers each translation unit included.
The reporter then classifies an unmapped header that appears in any compiled unit's include set as declaration-only (included, nothing executable), and leaves no-data for headers no unit included.
Alternative, cheaper but weaker: scan the header text for function definitions ({ bodies outside class/namespace declarations) and classify headers without any as declaration-only. Heuristic and fragile with templates and macros; the dependency-file route is exact.
Acceptance
Watchdog.hpp-style headers (included, no functions, no same-stem source) are reported as declaration-only.
no-data keeps only files no translation unit in the run compiled or included.
Unit test for both cases; end-to-end workspace gets one constants-only header without a companion source.
Manual's unmapped-files section describes the rule.
Activity
dcalavrezo-qorix commentedon Nov 17, 2026
not urgent