[CMake] cdash/coverage

Yngve Inntjore Levinsen yngve.levinsen at gmail.com
Thu Mar 29 05:16:59 EDT 2012


Dear developers,

I have what I think is a minor confusion about how to set up a client to do 
coverage analysis. I have added the coverage flags to a new build type 
"DebugCoverage", which also includes flags from the Debug build type.

My ctest script now looks something like this (uninteresting parts excluded):
...
ctest_start(ExperimentalCoverage)
set(cfg_options
  -DCMAKE_BUILD_TYPE=DebugCoverage
 )

set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
set(CTEST_UPDATE_COMMAND "cvs")

ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})

ctest_update()

ctest_configure(OPTIONS "${cfg_options}")
ctest_build(NUMBER_ERRORS PROJ_BUILD_ERRORS)
if(NOT ${PROJ_BUILD_ERRORS})
   ctest_test()
   ctest_coverage()
endif()
ctest_submit()

Now, when running the ctest_coverage(), it is complaining that it cannot find 
any of the .gcda files. The files are there from what I can see (I checked that 
they were there during the run of ctest_test() in a separate terminal). They 
are not empty. If I go to the build directory afterwards and manually run 
"make ExperimentalCoverage", then the coverage analysis is ran. I can then run 
"make ExperimentalSubmit" and the coverage analysis is submitted to the cdash 
dashboard.

May I ask if anyone of you see what my mistake is? Please do not hesitate to 
ask if more information is needed!

Cheers,
Yngve



More information about the CMake mailing list