mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-15 04:11:02 +01:00
build, test: Build db_tests.cpp
regardless of USE_BDB
While some tests are specific to BDB, `db_tests` as a whole are not limited to BDB.
This commit is contained in:
parent
433412fd84
commit
fd2d96d908
2 changed files with 3 additions and 6 deletions
|
@ -8,6 +8,7 @@ target_sources(test_bitcoin
|
||||||
PRIVATE
|
PRIVATE
|
||||||
init_test_fixture.cpp
|
init_test_fixture.cpp
|
||||||
wallet_test_fixture.cpp
|
wallet_test_fixture.cpp
|
||||||
|
db_tests.cpp
|
||||||
coinselector_tests.cpp
|
coinselector_tests.cpp
|
||||||
feebumper_tests.cpp
|
feebumper_tests.cpp
|
||||||
group_outputs_tests.cpp
|
group_outputs_tests.cpp
|
||||||
|
@ -22,10 +23,4 @@ target_sources(test_bitcoin
|
||||||
walletdb_tests.cpp
|
walletdb_tests.cpp
|
||||||
walletload_tests.cpp
|
walletload_tests.cpp
|
||||||
)
|
)
|
||||||
if(USE_BDB)
|
|
||||||
target_sources(test_bitcoin
|
|
||||||
PRIVATE
|
|
||||||
db_tests.cpp
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
target_link_libraries(test_bitcoin bitcoin_wallet)
|
target_link_libraries(test_bitcoin bitcoin_wallet)
|
||||||
|
|
|
@ -62,6 +62,7 @@ static void CheckPrefix(DatabaseBatch& batch, Span<const std::byte> prefix, Mock
|
||||||
|
|
||||||
BOOST_FIXTURE_TEST_SUITE(db_tests, BasicTestingSetup)
|
BOOST_FIXTURE_TEST_SUITE(db_tests, BasicTestingSetup)
|
||||||
|
|
||||||
|
#ifdef USE_BDB
|
||||||
static std::shared_ptr<BerkeleyEnvironment> GetWalletEnv(const fs::path& path, fs::path& database_filename)
|
static std::shared_ptr<BerkeleyEnvironment> GetWalletEnv(const fs::path& path, fs::path& database_filename)
|
||||||
{
|
{
|
||||||
fs::path data_file = BDBDataFile(path);
|
fs::path data_file = BDBDataFile(path);
|
||||||
|
@ -124,6 +125,7 @@ BOOST_AUTO_TEST_CASE(getwalletenv_g_dbenvs_free_instance)
|
||||||
BOOST_CHECK(env_1_a != env_1_b);
|
BOOST_CHECK(env_1_a != env_1_b);
|
||||||
BOOST_CHECK(env_2_a == env_2_b);
|
BOOST_CHECK(env_2_a == env_2_b);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static std::vector<std::unique_ptr<WalletDatabase>> TestDatabases(const fs::path& path_root)
|
static std::vector<std::unique_ptr<WalletDatabase>> TestDatabases(const fs::path& path_root)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue