Comments to exclude expected lines from code coverage report
Closed this issue · 0 comments
Rangi42 commented
contrib/coverage.bash generates a code coverage report with LCOV. It can be distracting to go through the results and mentally ignore red lines that are expected -- "verbose" printfs, required methods that happen not to run (e.g. a const alternative to a non-const getter, or operator== and operator!=), fatal errors that will never practically occur (e.g. defining so many anonymous labels they would overflow the counter), etc.
LCOV supports some comments to ignore these:
// LCOV_EXCL_LINEat the end of a line// LCOV_EXCL_STARTandLCOV_EXCL_STOPdelimiting blocks
These would be in the same vein as the // clang-format off comments preserving our occasional custom formatting, or // IWYU pragma comments for guiding include-what-you-use.