Results 21 comments of David Doria

Thanks, I'll try this today. I guess I'm surprised that the coverage analyzer is able to gather the output of multiple executables just because they are launched by the same...

Hm, I must be doing something wrong. Here is my CMakeLists.txt: ``` cmake Project(CoverageExampleProject) include(CTest) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_MODULE_PATH}) INCLUDE(CodeCoverage) SET(CMAKE_CXX_FLAGS="-g -O0 --coverage") SET(CMAKE_C_FLAGS="-g -O0 --coverage") SET(CMAKE_EXE_LINKER_FLAGS="--coverage") add_executable(CoverageExample CoverageExample.cpp) target_link_libraries(CoverageExample gcov)...

Makes sense. Let me know if you'd like me to test a patch. For the time being, I changed to : ``` cmake add_custom_target(ctest COMMAND ${CMAKE_CTEST_COMMAND}) SETUP_TARGET_FOR_COVERAGE(coverageTarget ctest "testResults") ```...

I tried it and noticed two things (I know you haven't tested yet, but I thought it may help): 1) I had to add include(CMakeParseArguments) or I got "Unknown CMake...

(Sorry we have parallel threads going) Adding add_definitions(-fprofile-arcs -ftest-coverage) indeed fixed it. I had: SET(CMAKE_CXX_FLAGS="-g -O0 -fprofile-arcs -ftest-coverage") SET(CMAKE_C_FLAGS="-g -O0 -fprofile-arcs -ftest-coverage") SET(CMAKE_EXE_LINKER_FLAGS="-fprofile-arcs -ftest-coverage") which I thought was the same...

I guess I don't understand which add_custom_target is doing any exit code checking? In your script you just run `COMMAND ${Coverage_EXECUTABLE}`, so what difference does it make if that "fails"...

I ended up with the following that seems to work. Thanks for your help! ``` add_custom_target(${Coverage_NAME}_cleanup COMMAND ${LCOV_PATH} --directory . --zerocounters WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMENT "Old coverage cleanup..." ) file(WRITE ${CMAKE_BINARY_DIR}/NoExitCodeTests.cmake...