Merge topic 'CTestCoverageCollectGCOV-log'

5b12fe4633 CTestCoverageCollectGCOV: Avoid capturing gcov output in QUIET mode
43aaf2ac1e CTestCoverageCollectGCOV: Capture gcov output in log file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4582
This commit is contained in:
Brad King
2020-04-09 12:29:03 +00:00
committed by Kitware Robot

View File

@@ -137,11 +137,23 @@ function(ctest_coverage_collect_gcov)
if(NOT DEFINED GCOV_GCOV_OPTIONS)
set(GCOV_GCOV_OPTIONS -b -x)
endif()
if (GCOV_QUIET)
set(coverage_out_opts
OUTPUT_QUIET
ERROR_QUIET
)
else()
set(coverage_out_opts
OUTPUT_FILE "${coverage_dir}/gcov.log"
ERROR_FILE "${coverage_dir}/gcov.log"
)
endif()
execute_process(COMMAND
${gcov_command} ${GCOV_GCOV_OPTIONS} ${gcda_files}
OUTPUT_VARIABLE out
RESULT_VARIABLE res
WORKING_DIRECTORY ${coverage_dir})
WORKING_DIRECTORY ${coverage_dir}
${coverage_out_opts}
)
if (GCOV_DELETE)
file(REMOVE ${gcda_files})
@@ -149,7 +161,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