mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-05-29 17:19:30 +02:00
Merge bitcoin/bitcoin#31617: build, test: Build db_tests.cpp
regardless of USE_BDB
fd2d96d9087be234bdf4a6eb6d563e92b4fb4501 build, test: Build `db_tests.cpp` regardless of `USE_BDB` (Hennadii Stepanov)
Pull request description:
When the building of `db_tests.cpp` was made conditional on `USE_BDB` in commit a58b719cf75e2d97205ec260bcff0d4780fe4fb8, all `db_tests` were indeed specific to BDB wallets.
However, the tests have since been [extended](ba616b932c
) to include SQLite wallets as well.
On the master branch @ 433412fd8478923dfdb20044f74c5d1e19fa8dd8, tests specific to SQLite wallets are not built and run if configured with `WITH_BDB=OFF` (the default option).
This PR resolves this issue by guarding BDB-specific code in `db_tests.cpp` and ensuring this source file is compiled regardless of the `WITH_BDB` option.
ACKs for top commit:
achow101:
ACK fd2d96d9087be234bdf4a6eb6d563e92b4fb4501
maflcko:
review ACK fd2d96d9087be234bdf4a6eb6d563e92b4fb4501 🔺
theuni:
utACK fd2d96d9087be234bdf4a6eb6d563e92b4fb4501
Tree-SHA512: bd9eddf16af60c568e931467d39e9e23a268e82e367ab630c23ac3cfd37e6007c6d78579b69ccbeebc1911c749cdbe75794fd56d7fbdb30c6fea6d2ab11017a3
This commit is contained in:
commit
54115d8de5
@ -8,6 +8,7 @@ target_sources(test_bitcoin
|
||||
PRIVATE
|
||||
init_test_fixture.cpp
|
||||
wallet_test_fixture.cpp
|
||||
db_tests.cpp
|
||||
coinselector_tests.cpp
|
||||
feebumper_tests.cpp
|
||||
group_outputs_tests.cpp
|
||||
@ -22,10 +23,4 @@ target_sources(test_bitcoin
|
||||
walletdb_tests.cpp
|
||||
walletload_tests.cpp
|
||||
)
|
||||
if(USE_BDB)
|
||||
target_sources(test_bitcoin
|
||||
PRIVATE
|
||||
db_tests.cpp
|
||||
)
|
||||
endif()
|
||||
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)
|
||||
|
||||
#ifdef USE_BDB
|
||||
static std::shared_ptr<BerkeleyEnvironment> GetWalletEnv(const fs::path& path, fs::path& database_filename)
|
||||
{
|
||||
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_2_a == env_2_b);
|
||||
}
|
||||
#endif
|
||||
|
||||
static std::vector<std::unique_ptr<WalletDatabase>> TestDatabases(const fs::path& path_root)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user