Skip to content

Commit a673521

Browse files
committed
test: skip tool_wallet test when bitcoin-wallet isn't compiled
1 parent e9277ba commit a673521

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

test/config.ini.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ RPCAUTH=@abs_top_srcdir@/share/rpcauth/rpcauth.py
1616
# Which components are enabled. These are commented out by `configure` if they were disabled when running config.
1717
@ENABLE_WALLET_TRUE@ENABLE_WALLET=true
1818
@BUILD_BITCOIN_CLI_TRUE@ENABLE_CLI=true
19+
@BUILD_BITCOIN_WALLET_TRUE@ENABLE_WALLET_TOOL=true
1920
@BUILD_BITCOIND_TRUE@ENABLE_BITCOIND=true
2021
@ENABLE_FUZZ_TRUE@ENABLE_FUZZ=true
2122
@ENABLE_ZMQ_TRUE@ENABLE_ZMQ=true

test/functional/test_framework/test_framework.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,11 @@ def skip_if_no_wallet(self):
596596
if not self.is_wallet_compiled():
597597
raise SkipTest("wallet has not been compiled.")
598598

599+
def skip_if_no_wallet_tool(self):
600+
"""Skip the running test if bitcoin-wallet has not been compiled."""
601+
if not self.is_wallet_tool_compiled():
602+
raise SkipTest("bitcoin-wallet has not been compiled")
603+
599604
def skip_if_no_cli(self):
600605
"""Skip the running test if bitcoin-cli has not been compiled."""
601606
if not self.is_cli_compiled():
@@ -609,6 +614,10 @@ def is_wallet_compiled(self):
609614
"""Checks whether the wallet module was compiled."""
610615
return self.config["components"].getboolean("ENABLE_WALLET")
611616

617+
def is_wallet_tool_compiled(self):
618+
"""Checks whether bitcoin-wallet was compiled."""
619+
return self.config["components"].getboolean("ENABLE_WALLET_TOOL")
620+
612621
def is_zmq_compiled(self):
613622
"""Checks whether the zmq module was compiled."""
614623
return self.config["components"].getboolean("ENABLE_ZMQ")

test/functional/tool_wallet.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def set_test_params(self):
2323

2424
def skip_test_if_missing_module(self):
2525
self.skip_if_no_wallet()
26+
self.skip_if_no_wallet_tool()
2627

2728
def bitcoin_wallet_process(self, *args):
2829
binary = self.config["environment"]["BUILDDIR"] + '/src/bitcoin-wallet' + self.config["environment"]["EXEEXT"]

0 commit comments

Comments
 (0)