mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-24 18:23:26 -03:00
cmake: Add fuzz_coverage
target
This commit is contained in:
parent
30e25a7fb9
commit
e82cc06990
1 changed files with 14 additions and 0 deletions
|
@ -428,6 +428,20 @@ if(BUILD_FOR_COVERAGE)
|
|||
DEPENDS ${PROJECT_BINARY_DIR}/total.coverage/index.html
|
||||
)
|
||||
add_dependencies(total_coverage test_bitcoin_coverage)
|
||||
else()
|
||||
if(NOT FUZZ_CORPORA_DIR)
|
||||
set(FUZZ_CORPORA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/qa-assets/fuzz_corpora)
|
||||
endif()
|
||||
add_custom_command(
|
||||
OUTPUT ${PROJECT_BINARY_DIR}/fuzz.coverage/index.html
|
||||
COMMAND Python3::Interpreter test/fuzz/test_runner.py ${FUZZ_CORPORA_DIR} --loglevel DEBUG
|
||||
COMMAND llvm-profdata merge --instr ${PROFILE_DATA_DIR}/*.profraw --output ${PROFILE_DATA_DIR}/fuzz.profdata
|
||||
COMMAND llvm-cov show -instr-profile=${PROFILE_DATA_DIR}/fuzz.profdata -object=$<TARGET_FILE:fuzz> -output-dir=${PROJECT_BINARY_DIR}/fuzz.coverage -format=html ${coverage_ignore_paths}
|
||||
DEPENDS fuzz
|
||||
)
|
||||
add_custom_target(fuzz_coverage
|
||||
DEPENDS ${PROJECT_BINARY_DIR}/fuzz.coverage/index.html
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue