diff options
author | Brad King <brad.king@kitware.com> | 2020-04-08 17:51:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-04-08 17:53:36 (GMT) |
commit | 5b12fe463364926a02c83decf9a52ee6de41d3f8 (patch) | |
tree | 81d46b94e6d5eb34d757d6ada8a38af518144638 /Modules/CTestCoverageCollectGCOV.cmake | |
parent | 43aaf2ac1eb5509b1ac408df0becda5da492fda1 (diff) | |
download | CMake-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.cmake | 17 |
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}) |