diff --git a/cmake/modules/TestSuite.cmake b/cmake/modules/TestSuite.cmake --- a/cmake/modules/TestSuite.cmake +++ b/cmake/modules/TestSuite.cmake @@ -18,7 +18,27 @@ endfunction(add_test_to_suite) function(add_boost_unit_tests_to_suite SUITE NAME) - add_test_to_suite(${SUITE} ${NAME} ${ARGN}) + cmake_parse_arguments(ARG + "" + "" + "TESTS" + ${ARGN} + ) + + add_executable(${NAME} EXCLUDE_FROM_ALL ${ARG_UNPARSED_ARGUMENTS}) + add_dependencies("check-${SUITE}" ${NAME}) + + foreach(_test_source ${ARG_TESTS}) + target_sources(${NAME} PRIVATE "${_test_source}") + get_filename_component(_test_name "${_test_source}" NAME_WE) + add_test( + NAME + "${_test_name}" + COMMAND + ${NAME} + -t "${_test_name}" + ) + endforeach() find_package(Boost 1.58 REQUIRED unit_test_framework) target_link_libraries(${NAME} Boost::unit_test_framework) diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -46,113 +46,115 @@ add_dependencies(check check-bitcoin) add_boost_unit_tests_to_suite(bitcoin test_bitcoin - activation_tests.cpp - addrman_tests.cpp - allocator_tests.cpp - amount_tests.cpp - arith_uint256_tests.cpp - avalanche_tests.cpp - base32_tests.cpp - base58_tests.cpp - base64_tests.cpp - bip32_tests.cpp - bitmanip_tests.cpp - blockchain_tests.cpp - blockcheck_tests.cpp - blockencodings_tests.cpp - blockfilter_tests.cpp - blockindex_tests.cpp - blockstatus_tests.cpp - bloom_tests.cpp - bswap_tests.cpp - cashaddr_tests.cpp - cashaddrenc_tests.cpp - checkdatasig_tests.cpp - checkpoints_tests.cpp - checkqueue_tests.cpp - coins_tests.cpp - compress_tests.cpp - config_tests.cpp - core_io_tests.cpp - crypto_tests.cpp - cuckoocache_tests.cpp - dbwrapper_tests.cpp - denialofservice_tests.cpp - descriptor_tests.cpp - dstencode_tests.cpp - excessiveblock_tests.cpp - feerate_tests.cpp - finalization_tests.cpp - flatfile_tests.cpp - getarg_tests.cpp - hash_tests.cpp - inv_tests.cpp jsonutil.cpp - key_io_tests.cpp - key_tests.cpp - lcg_tests.cpp - limitedmap_tests.cpp - main_tests.cpp - mempool_tests.cpp - merkle_tests.cpp - merkleblock_tests.cpp - miner_tests.cpp - monolith_opcodes_tests.cpp - multisig_tests.cpp - net_tests.cpp - netbase_tests.cpp - pmt_tests.cpp - policyestimator_tests.cpp - pow_tests.cpp - prevector_tests.cpp - radix_tests.cpp - raii_event_tests.cpp - random_tests.cpp - rcu_tests.cpp - reverselock_tests.cpp - rpc_tests.cpp - rpc_server_tests.cpp - rwcollection_tests.cpp - sanity_tests.cpp - scheduler_tests.cpp - schnorr_tests.cpp - script_bitfield_tests.cpp - script_commitment_tests.cpp - script_p2sh_tests.cpp - script_standard_tests.cpp - script_tests.cpp scriptflags.cpp - scriptnum_tests.cpp - serialize_tests.cpp - sigcache_tests.cpp - sigencoding_tests.cpp - sighash_tests.cpp - sighashtype_tests.cpp - sigopcount_tests.cpp sigutil.cpp - skiplist_tests.cpp - streams_tests.cpp - sync_tests.cpp test_bitcoin.cpp test_bitcoin_main.cpp - timedata_tests.cpp - torcontrol_tests.cpp - transaction_tests.cpp - txindex_tests.cpp - txvalidation_tests.cpp - txvalidationcache_tests.cpp - uint256_tests.cpp - undo_tests.cpp - util_tests.cpp - validation_block_tests.cpp - validation_tests.cpp - work_comparator_tests.cpp - - # RPC Tests - ../rpc/test/server_tests.cpp # Tests generated from JSON ${JSON_HEADERS} + + TESTS + activation_tests.cpp + addrman_tests.cpp + allocator_tests.cpp + amount_tests.cpp + arith_uint256_tests.cpp + avalanche_tests.cpp + base32_tests.cpp + base58_tests.cpp + base64_tests.cpp + bip32_tests.cpp + bitmanip_tests.cpp + blockchain_tests.cpp + blockcheck_tests.cpp + blockencodings_tests.cpp + blockfilter_tests.cpp + blockindex_tests.cpp + blockstatus_tests.cpp + bloom_tests.cpp + bswap_tests.cpp + cashaddr_tests.cpp + cashaddrenc_tests.cpp + checkdatasig_tests.cpp + checkpoints_tests.cpp + checkqueue_tests.cpp + coins_tests.cpp + compress_tests.cpp + config_tests.cpp + core_io_tests.cpp + crypto_tests.cpp + cuckoocache_tests.cpp + dbwrapper_tests.cpp + denialofservice_tests.cpp + descriptor_tests.cpp + dstencode_tests.cpp + excessiveblock_tests.cpp + feerate_tests.cpp + finalization_tests.cpp + flatfile_tests.cpp + getarg_tests.cpp + hash_tests.cpp + inv_tests.cpp + key_io_tests.cpp + key_tests.cpp + lcg_tests.cpp + limitedmap_tests.cpp + main_tests.cpp + mempool_tests.cpp + merkle_tests.cpp + merkleblock_tests.cpp + miner_tests.cpp + monolith_opcodes_tests.cpp + multisig_tests.cpp + net_tests.cpp + netbase_tests.cpp + pmt_tests.cpp + policyestimator_tests.cpp + pow_tests.cpp + prevector_tests.cpp + radix_tests.cpp + raii_event_tests.cpp + random_tests.cpp + rcu_tests.cpp + reverselock_tests.cpp + rpc_tests.cpp + rpc_server_tests.cpp + rwcollection_tests.cpp + sanity_tests.cpp + scheduler_tests.cpp + schnorr_tests.cpp + script_bitfield_tests.cpp + script_commitment_tests.cpp + script_p2sh_tests.cpp + script_standard_tests.cpp + script_tests.cpp + scriptnum_tests.cpp + serialize_tests.cpp + sigcache_tests.cpp + sigencoding_tests.cpp + sighash_tests.cpp + sighashtype_tests.cpp + sigopcount_tests.cpp + skiplist_tests.cpp + streams_tests.cpp + sync_tests.cpp + timedata_tests.cpp + torcontrol_tests.cpp + transaction_tests.cpp + txindex_tests.cpp + txvalidation_tests.cpp + txvalidationcache_tests.cpp + uint256_tests.cpp + undo_tests.cpp + util_tests.cpp + validation_block_tests.cpp + validation_tests.cpp + work_comparator_tests.cpp + + # RPC Tests + ../rpc/test/server_tests.cpp ) if (TEST_WITH_UPGRADE_ACTIVATED)