mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-25 00:59:19 -06:00
Merge topic 'CTestCoverageCollectGCOV-log'
5b12fe4633CTestCoverageCollectGCOV: Avoid capturing gcov output in QUIET mode43aaf2ac1eCTestCoverageCollectGCOV: Capture gcov output in log file Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4582
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user