diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -233,9 +233,6 @@ add_library(rpcclient rpc/client.cpp) target_link_libraries(rpcclient univalue util) -# Test suite. -add_subdirectory(test) - # bitcoin-seeder if(BUILD_BITCOIN_SEEDER) add_subdirectory(seeder) @@ -268,3 +265,6 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") target_sources(bitcoind PRIVATE bitcoind-res.rc) endif() + +# Test suite. +add_subdirectory(test) diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -80,3 +80,7 @@ # FIXME: We need to detect if that flag is required. For now assume it is. target_compile_definitions(test_bitcoin PRIVATE BOOST_TEST_DYN_LINK) + +if(BUILD_BITCOIN_WALLET) + target_link_libraries(test_bitcoin test_wallet) +endif() diff --git a/src/wallet/CMakeLists.txt b/src/wallet/CMakeLists.txt --- a/src/wallet/CMakeLists.txt +++ b/src/wallet/CMakeLists.txt @@ -24,3 +24,6 @@ find_package(Event REQUIRED) target_include_directories(wallet PRIVATE ${EVENT_INCLUDE_DIR}) target_link_libraries(wallet ${EVENT_LIBRARY}) + +# Wallet tests +add_subdirectory(test) diff --git a/src/wallet/test/CMakeLists.txt b/src/wallet/test/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/src/wallet/test/CMakeLists.txt @@ -0,0 +1,15 @@ +# Copyright (c) 2018 The Bitcoin developers + +project(test-wallet) + +add_library(test_wallet + wallet_test_fixture.cpp + wallet_test_fixture.h + accounting_tests.cpp + wallet_tests.cpp + walletdb_tests.cpp + crypto_tests.cpp +) + +# It is dubious that server is a dependency here, but it is. +target_link_libraries(test_wallet wallet server)