summaryrefslogtreecommitdiffstats
path: root/Modules/CTestCoverageCollectGCOV.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-04-08 17:51:36 (GMT)
committerBrad King <brad.king@kitware.com>2020-04-08 17:53:36 (GMT)
commit5b12fe463364926a02c83decf9a52ee6de41d3f8 (patch)
tree81d46b94e6d5eb34d757d6ada8a38af518144638 /Modules/CTestCoverageCollectGCOV.cmake
parent43aaf2ac1eb5509b1ac408df0becda5da492fda1 (diff)
downloadCMake-5b12fe463364926a02c83decf9a52ee6de41d3f8.zip
CMake-5b12fe463364926a02c83decf9a52ee6de41d3f8.tar.gz
CMake-5b12fe463364926a02c83decf9a52ee6de41d3f8.tar.bz2
CTestCoverageCollectGCOV: Avoid capturing gcov output in QUIET mode
The `QUIET` mode suppresses any mention of our logged output, so do not bother logging it. This also provides a way for users to avoid saving possibly large output on disk. Fixes: #20554
Diffstat (limited to 'Modules/CTestCoverageCollectGCOV.cmake')
-rw-r--r--Modules/CTestCoverageCollectGCOV.cmake17
1 files changed, 14 insertions, 3 deletions
diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake
index 43540da..b498086 100644
--- a/Modules/CTestCoverageCollectGCOV.cmake
+++ b/Modules/CTestCoverageCollectGCOV.cmake
@@ -137,12 +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_FILE "${coverage_dir}/gcov.log"
- ERROR_FILE "${coverage_dir}/gcov.log"
RESULT_VARIABLE res
- WORKING_DIRECTORY ${coverage_dir})
+ WORKING_DIRECTORY ${coverage_dir}
+ ${coverage_out_opts}
+ )
if (GCOV_DELETE)
file(REMOVE ${gcda_files})