From 30e25a7fb93c45ee6308bdf213fa9088003a1459 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Fri, 29 Nov 2024 12:36:07 +0000 Subject: [PATCH] cmake: Add `total_coverage` target --- CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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()