test: Pass bench exe into test framework utils

This teaches the test framework about the bench executable, which is
required for the next commit.
This commit is contained in:
MarcoFalke committed 2026-01-01 20:38:59 +01:00
1 parent 315fdb4066
commit fa9fdbce79
5 files changed
+17

No files matched your search

@@ -943,6 +943,11 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
if not self.is_bitcoin_chainstate_compiled():
raise SkipTest("bitcoin-chainstate has not been compiled")
def skip_if_no_bitcoin_bench(self):
"""Skip the running test if bench_bitcoin has not been compiled."""
if not self.is_bench_compiled():
raise SkipTest("bench_bitcoin has not been compiled")
def skip_if_no_cli(self):
"""Skip the running test if bitcoin-cli has not been compiled."""
if not self.is_cli_compiled():
@@ -976,6 +981,10 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
if self.options.valgrind:
raise SkipTest("This test is not compatible with Valgrind.")
def is_bench_compiled(self):
"""Checks whether bench_bitcoin was compiled."""
return self.config["components"].getboolean("BUILD_BENCH")
def is_cli_compiled(self):
"""Checks whether bitcoin-cli was compiled."""
return self.config["components"].getboolean("ENABLE_CLI")
+5
View File
@@ -261,6 +261,10 @@ class Binaries:
# Add -nonamed because "bitcoin rpc" enables -named by default, but bitcoin-cli doesn't
return self._argv("rpc", self.paths.bitcoincli) + ["-nonamed"]
def bench_argv(self):
"Return argv array that should be used to invoke bench_bitcoin"
return self._argv("bench", self.paths.bitcoin_bench)
def tx_argv(self):
"Return argv array that should be used to invoke bitcoin-tx"
return self._argv("tx", self.paths.bitcointx)
@@ -301,6 +305,7 @@ def get_binary_paths(config):
binaries = {
"bitcoin": "BITCOIN_BIN",
"bitcoind": "BITCOIND",
"bench_bitcoin": "BITCOIN_BENCH",
"bitcoin-cli": "BITCOINCLI",
"bitcoin-util": "BITCOINUTIL",
"bitcoin-tx": "BITCOINTX",