CTestCoverageCollectGCOV: Log gcov output
I am using CTestCoverageCollectGCOV.cmake
to generate and upload coverage information to CDash. The tool is working to my expectations except that the volume of output is very large. My regression log files are in the 10 GB range for each coverage build with ctest. This can be fixed by adding ERROR_QUIET
and OUTPUT_QUIET
to the execute_process
command that runs gcov.
# run gcov, this will produce the .gcov files in the current
# working directory
if(NOT DEFINED GCOV_GCOV_OPTIONS)
set(GCOV_GCOV_OPTIONS -b -x)
endif()
execute_process(COMMAND
${gcov_command} ${GCOV_GCOV_OPTIONS} ${gcda_files}
OUTPUT_VARIABLE out
RESULT_VARIABLE res
WORKING_DIRECTORY ${coverage_dir}
+ ERROR_QUIET
+ OUTPUT_QUIET
)
if (GCOV_DELETE)
file(REMOVE ${gcda_files})
endif()
The addition of these options could be tied to the value of GCOV_QUIET
, but personally, I think they should always be enabled. This small change reduces my 10 GB size regression log file to about 3 MB!
Edited by Brad King