Skip to content
Draft
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
6 changes: 5 additions & 1 deletion cmake/GzCodeCoverage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,14 @@ FUNCTION(gz_setup_target_for_coverage)
# Capturing lcov counters and generating report
COMMAND ${LCOV_PATH} ${_branch_flags} -q --no-checksum
--directory ${PROJECT_BINARY_DIR} --capture
--output-file ${_outputname}.info 2>/dev/null
--ignore-errors gcov,gcov
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it make sense instead of ignoring categories doing it per files / per directories, something like:

 --exclude '/usr/include/*' \
 --exclude '*_TEST.cc' \

Copy link
Member Author

Choose a reason for hiding this comment

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

we use --remove with lots of path wildcards on line 152. I'm not sure what the best approach is here. I think we would need to test with more packages as well so see if more --ignore-errors categories are needed

--ignore-errors mismatch,mismatch
--ignore-errors unused,unused
--output-file ${_outputname}.info
# Remove negative counts
COMMAND sed -i '/,-/d' ${_outputname}.info
COMMAND ${LCOV_PATH} ${_branch_flags} -q
--ignore-errors unused,unused
--remove ${_outputname}.info '*/test/*' '/usr/*' '*_TEST*' '*.cxx' 'moc_*.cpp' 'qrc_*.cpp' '*.pb.*' '*/build/*' '*/install/*' ${IGNORE_LIST} --output-file ${_outputname}.info.cleaned
COMMAND ${GENHTML_PATH} ${_branch_flags} -q --prefix ${PROJECT_SOURCE_DIR}
--legend -o ${_outputname} ${_outputname}.info.cleaned
Expand Down