fix: exclude test files from code coverage analysis#52
Merged
davidirvine merged 2 commits intodevelopfrom Jul 25, 2025
Merged
Conversation
Owner
davidirvine
commented
Jul 25, 2025
- Add lcov --remove patterns to exclude test directory from coverage
- Remove test/*.cpp files and doctest framework files from coverage reports
- Ensure coverage only measures production code in src/ directory
- Coverage reports will now correctly show only source code coverage, not test code
- Add lcov --remove patterns to exclude test directory from coverage - Remove test/*.cpp files and doctest framework files from coverage reports - Ensure coverage only measures production code in src/ directory - Coverage reports will now correctly show only source code coverage, not test code
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR improves code coverage analysis by excluding test files and test-related dependencies from coverage reports. The changes ensure that coverage metrics reflect only production code quality by filtering out test directories, test files, and testing framework files.
- Adds lcov exclusion patterns to remove test directories and files from coverage analysis
- Excludes doctest framework files from coverage reports
- Ensures coverage reports focus solely on source code in the production codebase
- Add --ignore-errors unused flag to lcov --remove command - Combine multiple remove operations into single command for efficiency - Fixes exit code 25 error when exclude patterns don't match any files - Coverage job will now complete successfully even when some patterns are unused
|
Coverage after merging code-coverage-fix into develop will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.