CTestCoverageCollectGCOV: Capture gcov output in log file

The output of gcov can be large and we only display it in a failure
case.  Put it in a log file to avoid accumulating large output in
memory.

Issue: #20554
This commit is contained in:
Brad King
2020-04-08 07:55:46 -04:00
parent 09d28262bf
commit 43aaf2ac1e

View File

@@ -139,7 +139,8 @@ function(ctest_coverage_collect_gcov)
endif()
execute_process(COMMAND
${gcov_command} ${GCOV_GCOV_OPTIONS} ${gcda_files}
OUTPUT_VARIABLE out
OUTPUT_FILE "${coverage_dir}/gcov.log"
ERROR_FILE "${coverage_dir}/gcov.log"
RESULT_VARIABLE res
WORKING_DIRECTORY ${coverage_dir})
@@ -149,7 +150,7 @@ function(ctest_coverage_collect_gcov)
if(NOT "${res}" EQUAL 0)
if (NOT GCOV_QUIET)
message(STATUS "Error running gcov: ${res} ${out}")
message(STATUS "Error running gcov: ${res}, see\n ${coverage_dir}/gcov.log")
endif()
endif()
# create json file with project information