summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-04-09 12:29:03 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-04-09 12:29:12 (GMT)
commite2a1b463a9d10907b9469dd2b413aca80f6f3ecd (patch)
tree7919642aad6179b65fb8ee2941f06083c92b3dd4 /Modules
parent4d54c15707861493e8e4bf9d4fe0f4a4744d7f5c (diff)
parent5b12fe463364926a02c83decf9a52ee6de41d3f8 (diff)
downloadCMake-e2a1b463a9d10907b9469dd2b413aca80f6f3ecd.zip
CMake-e2a1b463a9d10907b9469dd2b413aca80f6f3ecd.tar.gz
CMake-e2a1b463a9d10907b9469dd2b413aca80f6f3ecd.tar.bz2
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
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CTestCoverageCollectGCOV.cmake18
1 files changed, 15 insertions, 3 deletions
diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake
index ff48cc2..b498086 100644
--- a/Modules/CTestCoverageCollectGCOV.cmake
+++ b/Modules/CTestCoverageCollectGCOV.cmake
@@ -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