Skip to content

fix: exclude test files from code coverage analysis#52

Merged
davidirvine merged 2 commits intodevelopfrom
code-coverage-fix
Jul 25, 2025
Merged

fix: exclude test files from code coverage analysis#52
davidirvine merged 2 commits intodevelopfrom
code-coverage-fix

Conversation

@davidirvine
Copy link
Copy Markdown
Owner

  • 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
Copilot AI review requested due to automatic review settings July 25, 2025 00:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread .github/workflows/ci.yml Outdated
- 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
@github-actions
Copy link
Copy Markdown

Coverage after merging code-coverage-fix into develop will be

94.27%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src/ranges
   range.hpp96%100%100%94.44%57
   scaler.hpp100%100%100%100%
src/unitshapers
   bezier.hpp100%100%100%100%
   linear.hpp100%100%100%100%
src/util
   namedtype.hpp100%100%100%100%
src/voice
   deepnotevoice.hpp93.53%100%96.15%93.06%111, 131, 135, 153, 157, 161, 165, 405, 78, 94
   frequencytable.hpp100%100%100%100%

@davidirvine davidirvine merged commit 4e020b0 into develop Jul 25, 2025
10 checks passed
@davidirvine davidirvine deleted the code-coverage-fix branch July 25, 2025 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants