Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/local-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Copy link
Copy Markdown

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 --extract patterns match no tracefile records, LCOV_IGN suppresses the unused error, 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
In `tests/local-test.sh` at line 34:

**Coverage artifacts omit expected sources**

When all configured `--extract` patterns match no tracefile records, `LCOV_IGN` suppresses the `unused` error, 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`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The 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, 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.

Prompt for AI agents
In `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
Expand Down
2 changes: 1 addition & 1 deletion tests/qmake-lcov-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,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"
fi

lcov $LCOV_IGN -d $build_dir -c -o $build_dir/coverage.info
Expand Down
2 changes: 1 addition & 1 deletion tests/test-prj-running.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ workdir="${build_path}"
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"
fi

lcov $LCOV_IGN --directory "${workdir}" --zerocounters || true
Expand Down
Loading