Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comments to exclude expected lines from code coverage report #1636

Open
Rangi42 opened this issue Jan 29, 2025 · 0 comments
Open

Comments to exclude expected lines from code coverage report #1636

Rangi42 opened this issue Jan 29, 2025 · 0 comments
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

Comments

@Rangi42
Copy link
Contributor

Rangi42 commented Jan 29, 2025

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_LINE at the end of a line
  • // LCOV_EXCL_START and LCOV_EXCL_STOP delimiting 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.

@Rangi42 Rangi42 added 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 labels Jan 29, 2025
@Rangi42 Rangi42 added this to the 0.9.1 milestone Jan 29, 2025
@Rangi42 Rangi42 self-assigned this Jan 30, 2025
@Rangi42 Rangi42 modified the milestones: 0.9.1, 0.9.2 Feb 2, 2025
@Rangi42 Rangi42 removed their assignment Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

1 participant