diff --git a/01/tests/CMakeLists.txt b/01/tests/CMakeLists.txt index f2a2124..7437db3 100644 --- a/01/tests/CMakeLists.txt +++ b/01/tests/CMakeLists.txt @@ -62,11 +62,14 @@ if(ENABLE_COVERAGE) add_dependencies(coverage tests ${PROJECT_NAME}) add_custom_command( OUTPUT ${covname} + COMMAND rm -rf **/coverage COMMAND ${LCOV} -c -o ${covname} -d ${CMAKE_BINARY_DIR}/tests/CMakeFiles/tests.dir/ -b . --gcov-tool ${GCOV} COMMAND ${LCOV} -r ${covname} -o ${covname} "*/tests/*" "*/_deps/**/*" "/usr/include/c++/**/*" "/usr/include/c++/11/**/*" COMMAND ${LCOV} -l ${covname} COMMAND ${GENHTML} ${covname} -output coverage COMMAND ${LCOV} -l ${covname} 2>/dev/null | grep Total | sed 's/|//g' | sed 's/Total://g' | awk '{print $1}' | sed s/%//g > coverage/total + COMMAND rm -rf CMakeFiles/tests.dir/src/*.gcda CMakeFiles/tests.dir/src/*.gcno + COMMAND rm -f ${covname} ) set_directory_properties(PROPERTIES ADDITIONAL_CLEAN_FILES ${covname} diff --git a/C_Tempate/tests/CMakeLists.txt b/C_Tempate/tests/CMakeLists.txt index f2a2124..7437db3 100644 --- a/C_Tempate/tests/CMakeLists.txt +++ b/C_Tempate/tests/CMakeLists.txt @@ -62,11 +62,14 @@ if(ENABLE_COVERAGE) add_dependencies(coverage tests ${PROJECT_NAME}) add_custom_command( OUTPUT ${covname} + COMMAND rm -rf **/coverage COMMAND ${LCOV} -c -o ${covname} -d ${CMAKE_BINARY_DIR}/tests/CMakeFiles/tests.dir/ -b . --gcov-tool ${GCOV} COMMAND ${LCOV} -r ${covname} -o ${covname} "*/tests/*" "*/_deps/**/*" "/usr/include/c++/**/*" "/usr/include/c++/11/**/*" COMMAND ${LCOV} -l ${covname} COMMAND ${GENHTML} ${covname} -output coverage COMMAND ${LCOV} -l ${covname} 2>/dev/null | grep Total | sed 's/|//g' | sed 's/Total://g' | awk '{print $1}' | sed s/%//g > coverage/total + COMMAND rm -rf CMakeFiles/tests.dir/src/*.gcda CMakeFiles/tests.dir/src/*.gcno + COMMAND rm -f ${covname} ) set_directory_properties(PROPERTIES ADDITIONAL_CLEAN_FILES ${covname}