diff --git a/CMakeLists.txt b/CMakeLists.txt index 341d04bb083..ad69ce2e38d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -416,6 +416,18 @@ if(BUILD_FOR_COVERAGE) add_custom_target(test_bitcoin_coverage DEPENDS ${PROJECT_BINARY_DIR}/test_bitcoin.coverage/index.html ) + + add_custom_command( + OUTPUT ${PROJECT_BINARY_DIR}/total.coverage/index.html + COMMAND Python3::Interpreter ${PROJECT_BINARY_DIR}/test/functional/test_runner.py + COMMAND llvm-profdata merge --instr ${PROFILE_DATA_DIR}/*.profraw --output ${PROFILE_DATA_DIR}/total.profdata + COMMAND llvm-cov show -instr-profile=${PROFILE_DATA_DIR}/total.profdata -object=$ -object=$ -object=$ -object=$ -object=$ -object=$ -output-dir=${PROJECT_BINARY_DIR}/total.coverage -format=html ${coverage_ignore_paths} + DEPENDS bitcoind bitcoin-cli bitcoin-wallet + ) + add_custom_target(total_coverage + DEPENDS ${PROJECT_BINARY_DIR}/total.coverage/index.html + ) + add_dependencies(total_coverage test_bitcoin_coverage) endif() endif()