# Copyright (c) 2024-present The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or https://opensource.org/license/mit/. include(${CMAKE_CURRENT_LIST_DIR}/CoverageInclude.cmake) if(NOT DEFINED FUZZ_SEED_CORPUS_DIR) set(FUZZ_SEED_CORPUS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/qa-assets/fuzz_seed_corpus) endif() execute_process( COMMAND test/fuzz/test_runner.py ${FUZZ_SEED_CORPUS_DIR} --loglevel DEBUG WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} COMMAND_ERROR_IS_FATAL ANY ) execute_process( COMMAND ${LCOV_COMMAND} --capture --directory src --test-name fuzz-tests --output-file fuzz.info WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} ) execute_process( COMMAND ${LCOV_COMMAND} --zerocounters --directory src WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} ) execute_process( COMMAND ${LCOV_FILTER_COMMAND} fuzz.info fuzz_filtered.info WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} ) execute_process( COMMAND ${LCOV_COMMAND} --add-tracefile fuzz_filtered.info --output-file fuzz_filtered.info WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} ) execute_process( COMMAND ${LCOV_COMMAND} --add-tracefile baseline_filtered.info --add-tracefile fuzz_filtered.info --output-file fuzz_coverage.info COMMAND ${GREP_EXECUTABLE} "%" COMMAND ${AWK_EXECUTABLE} "{ print substr($3,2,50) \"/\" $5 }" OUTPUT_FILE coverage_percent.txt WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} ) execute_process( COMMAND ${GENHTML_COMMAND} fuzz_coverage.info --output-directory fuzz.coverage WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} )