Comments to exclude expected lines from code coverage report #1636
Labels
meta
This isn't related to the tools directly: repo organization, maintainership...
refactoring
This PR is intended to clean up code more than change functionality
Milestone
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. aconst
alternative to a non-const
getter, oroperator==
andoperator!=
), 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_LINE
at the end of a line// LCOV_EXCL_START
andLCOV_EXCL_STOP
delimiting blocksThese 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.The text was updated successfully, but these errors were encountered: