Repository navigation
fix(ut): suppress lcov 2.x unused error for extract patterns #468
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,7 +31,7 @@ $build_dir/$executable --gtest_output=xml:$result_report_dir | |
| LCOV_MAJOR=$(lcov --version 2>/dev/null | grep -oE '[0-9]+(\.[0-9]+)+' | head -1 | cut -d. -f1) | ||
| LCOV_IGN="" | ||
| if [ "${LCOV_MAJOR:-0}" -ge 2 ]; then | ||
| LCOV_IGN="--ignore-errors inconsistent,mismatch" | ||
| LCOV_IGN="--ignore-errors inconsistent,mismatch,unused" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Medium · Test code inflates project coverage When test source paths do not match the removal glob, Do not pass the Also at Prompt for AI agentsIn `tests/local-test.sh` at line 34:
**Test code inflates project coverage**
When test source paths do not match the removal glob, `LCOV_IGN` also reaches each `lcov --remove` command, suppressing its `unused` error; test records remain in `coverage.info`, so the report counts test code as project coverage.
Do not pass the `unused` ignore setting to `lcov --remove`, so unmatched exclusion patterns fail rather than leave test records in the report.
Also at `tests/qmake-lcov-test.sh:26`, `tests/test-prj-running.sh:62`. |
||
| fi | ||
|
|
||
| lcov $LCOV_IGN -d $build_dir -c -o $build_dir/coverage.info | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Medium · Coverage artifacts omit expected sources
When all configured
--extractpatterns match no tracefile records,LCOV_IGNsuppresses theunusederror, and the scripts do not verify the extraction result, so collection succeeds with empty or incomplete coverage artifacts.Check that extraction selects the intended source records and fail collection when it does not.
Also at
tests/qmake-lcov-test.sh:26,tests/test-prj-running.sh:62.Prompt for AI agents