diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-11-23 15:53:35 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-11-23 15:53:40 +0100 |
commit | 2ee954daaee5758d04935492139808cb6fd95233 (patch) | |
tree | 9a5d5ac7dadf907b7478fd66f5b7521cfe0efe9f | |
parent | 555b5d1bf940646a728499cfa1005bcb61383c20 (diff) | |
parent | b87caf10b57fbab148949727f4004805be2bbc1d (diff) |
Merge #20458: test: add is_bdb_compiled helper
b87caf10b57fbab148949727f4004805be2bbc1d test: add is_bdb_compiled helper (Sjors Provoost)
Pull request description:
Followup for #20202, needed by #16546.
Allow the functional test suite to skip tests that require BDB, as well as introduce specific logic to handle whether BDB support is enabled or not. It follows the same pattern as `skip_if_no_sqlite` and `is_sqlite_compiled`.
ACKs for top commit:
laanwj:
Code review ACK b87caf10b57fbab148949727f4004805be2bbc1d
Tree-SHA512: e84fb22e017b28f0f75d17e5368fcba22a893484b31b12082cfe9354e6fbd566daf34b3b82f7deb7205b2061c9c61538e402df000e2f05428affae6dbea05c5e
-rw-r--r-- | test/config.ini.in | 1 | ||||
-rwxr-xr-x | test/functional/test_framework/test_framework.py | 11 |
2 files changed, 11 insertions, 1 deletions
diff --git a/test/config.ini.in b/test/config.ini.in index 4b4a092a9d..77c9a720c3 100644 --- a/test/config.ini.in +++ b/test/config.ini.in @@ -17,6 +17,7 @@ RPCAUTH=@abs_top_srcdir@/share/rpcauth/rpcauth.py # Which components are enabled. These are commented out by `configure` if they were disabled when running config. @ENABLE_WALLET_TRUE@ENABLE_WALLET=true @USE_SQLITE_TRUE@USE_SQLITE=true +@USE_BDB_TRUE@USE_BDB=true @BUILD_BITCOIN_CLI_TRUE@ENABLE_CLI=true @BUILD_BITCOIN_WALLET_TRUE@ENABLE_WALLET_TOOL=true @BUILD_BITCOIND_TRUE@ENABLE_BITCOIND=true diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py index 831599913d..bf047c5f68 100755 --- a/test/functional/test_framework/test_framework.py +++ b/test/functional/test_framework/test_framework.py @@ -782,6 +782,11 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass): if not self.is_sqlite_compiled(): raise SkipTest("sqlite has not been compiled.") + def skip_if_no_bdb(self): + """Skip the running test if BDB has not been compiled.""" + if not self.is_bdb_compiled(): + raise SkipTest("BDB has not been compiled.") + def skip_if_no_wallet_tool(self): """Skip the running test if bitcoin-wallet has not been compiled.""" if not self.is_wallet_tool_compiled(): @@ -822,5 +827,9 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass): return self.config["components"].getboolean("ENABLE_ZMQ") def is_sqlite_compiled(self): - """Checks whether the wallet module was compiled.""" + """Checks whether the wallet module was compiled with Sqlite support.""" return self.config["components"].getboolean("USE_SQLITE") + + def is_bdb_compiled(self): + """Checks whether the wallet module was compiled with BDB support.""" + return self.config["components"].getboolean("USE_BDB") |