Skip to content
Snippets Groups Projects
Commit f79286bd authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Force removing of .gcda files to avoid merging of obsolete files

These merge could generate coverage failures
One should use cmake commands instead of unix find+rm for portability
parent bf73ccfa
No related branches found
No related tags found
1 merge request!37Feature/language
...@@ -250,9 +250,16 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Coverage") ...@@ -250,9 +250,16 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Coverage")
set(GCOVR_OPTIONS --object-directory="${PUGS_BINARY_DIR}" -r "${PUGS_SOURCE_DIR}/src" ${GCOVR_EXCLUDE} ${GCOVR_EXTRA}) set(GCOVR_OPTIONS --object-directory="${PUGS_BINARY_DIR}" -r "${PUGS_SOURCE_DIR}/src" ${GCOVR_EXCLUDE} ${GCOVR_EXTRA})
add_custom_target(coverage-clean-up
ALL
COMMAND find "${PUGS_BINARY_DIR}" -name \*.gcda -exec rm -f {} +;
COMMENT "Removing obsolete gcda to perform a net coverage."
)
add_custom_target(coverage add_custom_target(coverage
ALL ALL
COMMAND ${GCOVR} ${GCOVR_OPTIONS} --exclude-unreachable-branches --sort-percentage COMMAND ${GCOVR} ${GCOVR_OPTIONS} --exclude-unreachable-branches --sort-percentage
DEPENDS coverage-clean-up
DEPENDS run_unit_tests pugs DEPENDS run_unit_tests pugs
COMMENT "Running gcovr to build coverage report." COMMENT "Running gcovr to build coverage report."
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment