Changeset View
Changeset View
Standalone View
Standalone View
src/test/CMakeLists.txt
# Copyright (c) 2018 The Bitcoin developers | # Copyright (c) 2018 The Bitcoin developers | ||||
project(bitcoin-test) | project(bitcoin-test) | ||||
option(ENABLE_PROPERTY_BASED_TESTS "Enable property based tests" OFF) | |||||
# Process json files. | # Process json files. | ||||
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/data") | file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/data") | ||||
function(gen_json_header NAME) | function(gen_json_header NAME) | ||||
set(HEADERS "") | set(HEADERS "") | ||||
foreach(f ${ARGN}) | foreach(f ${ARGN}) | ||||
set(h "${CMAKE_CURRENT_BINARY_DIR}/${f}.h") | set(h "${CMAKE_CURRENT_BINARY_DIR}/${f}.h") | ||||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | set(BITCOIN_WALLET_TESTS | ||||
../wallet/test/ismine_tests.cpp | ../wallet/test/ismine_tests.cpp | ||||
../wallet/test/psbt_wallet_tests.cpp | ../wallet/test/psbt_wallet_tests.cpp | ||||
../wallet/test/wallet_tests.cpp | ../wallet/test/wallet_tests.cpp | ||||
../wallet/test/walletdb_tests.cpp | ../wallet/test/walletdb_tests.cpp | ||||
../wallet/test/wallet_crypto_tests.cpp | ../wallet/test/wallet_crypto_tests.cpp | ||||
) | ) | ||||
endif() | endif() | ||||
if(ENABLE_PROPERTY_BASED_TESTS) | |||||
find_package(Rapidcheck REQUIRED) | |||||
set(BITCOIN_PROPERTY_BASED_TEST_FIXTURE | |||||
gen/crypto_gen.cpp | |||||
) | |||||
set(BITCOIN_PROPERTY_BASED_TESTS | |||||
key_properties.cpp | |||||
) | |||||
endif() | |||||
add_boost_unit_tests_to_suite(bitcoin test_bitcoin | add_boost_unit_tests_to_suite(bitcoin test_bitcoin | ||||
fixture.cpp | fixture.cpp | ||||
jsonutil.cpp | jsonutil.cpp | ||||
scriptflags.cpp | scriptflags.cpp | ||||
sigutil.cpp | sigutil.cpp | ||||
# Tests generated from JSON | # Tests generated from JSON | ||||
${JSON_HEADERS} | ${JSON_HEADERS} | ||||
# Wallet test fixture | # Wallet test fixture | ||||
${BITCOIN_WALLET_TEST_FIXTURE} | ${BITCOIN_WALLET_TEST_FIXTURE} | ||||
# Properties based test fixture | |||||
${BITCOIN_PROPERTY_BASED_TEST_FIXTURE} | |||||
TESTS | TESTS | ||||
activation_tests.cpp | activation_tests.cpp | ||||
addrman_tests.cpp | addrman_tests.cpp | ||||
allocator_tests.cpp | allocator_tests.cpp | ||||
amount_tests.cpp | amount_tests.cpp | ||||
arith_uint256_tests.cpp | arith_uint256_tests.cpp | ||||
base32_tests.cpp | base32_tests.cpp | ||||
base58_tests.cpp | base58_tests.cpp | ||||
▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | TESTS | ||||
versionbits_tests.cpp | versionbits_tests.cpp | ||||
work_comparator_tests.cpp | work_comparator_tests.cpp | ||||
# RPC Tests | # RPC Tests | ||||
../rpc/test/server_tests.cpp | ../rpc/test/server_tests.cpp | ||||
# Wallet tests | # Wallet tests | ||||
${BITCOIN_WALLET_TESTS} | ${BITCOIN_WALLET_TESTS} | ||||
# Properties based tests | |||||
${BITCOIN_PROPERTY_BASED_TESTS} | |||||
) | ) | ||||
if(ENABLE_PROPERTY_BASED_TESTS) | |||||
target_link_libraries(test_bitcoin Rapidcheck::rapidcheck) | |||||
endif() | |||||
function(add_boost_test_runners_with_upgrade_activated SUITE EXECUTABLE) | function(add_boost_test_runners_with_upgrade_activated SUITE EXECUTABLE) | ||||
set(SUITE_UPGRADE_ACTIVATED "${SUITE}-upgrade-activated") | set(SUITE_UPGRADE_ACTIVATED "${SUITE}-upgrade-activated") | ||||
get_target_from_suite(${SUITE_UPGRADE_ACTIVATED} TARGET_UPGRADE_ACTIVATED) | get_target_from_suite(${SUITE_UPGRADE_ACTIVATED} TARGET_UPGRADE_ACTIVATED) | ||||
if(NOT TARGET ${TARGET_UPGRADE_ACTIVATED}) | if(NOT TARGET ${TARGET_UPGRADE_ACTIVATED}) | ||||
create_test_suite_with_parent_targets( | create_test_suite_with_parent_targets( | ||||
${SUITE_UPGRADE_ACTIVATED} | ${SUITE_UPGRADE_ACTIVATED} | ||||
check-upgrade-activated | check-upgrade-activated | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |