Skip to content

Commit

Permalink
try different method for coverage comments
Browse files Browse the repository at this point in the history
  • Loading branch information
phlptp committed Nov 16, 2024
1 parent 6021037 commit 15aa130
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions cmake/CodeCoverage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -394,20 +394,30 @@ function(setup_target_for_coverage_lcov)
COMMAND ${LCOV_BASELINE_COUNT_CMD}
COMMAND ${LCOV_FILTER_CMD}
COMMAND ${LCOV_GEN_HTML_CMD} ${GCOVR_XML_CMD_COMMAND}
COMMAND ${CMAKE_COMMAND} -E echo "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report."
COMMAND ${CMAKE_COMMAND} -E echo "Lcov code coverage info report saved in ${Coverage_NAME}.info."
COMMAND ${CMAKE_COMMAND} -E echo ${GCOVR_XML_CMD_COMMENT}
COMMAND ${CMAKE_COMMAND} -E echo "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report."
# Set output files as GENERATED (will be removed on 'make clean')
BYPRODUCTS ${Coverage_NAME}.base ${Coverage_NAME}.capture ${Coverage_NAME}.total
${Coverage_NAME}.info ${GCOVR_XML_CMD_BYPRODUCTS} ${Coverage_NAME}/index.html
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
DEPENDS ${Coverage_DEPENDENCIES}
VERBATIM # Protect arguments to commands


COMMENT
"Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report."
)

# Show where to find the lcov info report
add_custom_command(
TARGET ${Coverage_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E echo "Lcov code coverage info report saved in ${Coverage_NAME}.info."
COMMENT ${GCOVR_XML_CMD_COMMENT})

# Show info where to find the report
add_custom_command(
TARGET ${Coverage_NAME}
POST_BUILD
COMMAND "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report."
)

endfunction() # setup_target_for_coverage_lcov

# Defines a target for running and collection code coverage information
Expand Down

0 comments on commit 15aa130

Please sign in to comment.