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:
5 files changed
+17
No files matched your search
@@ -320,6 +320,7 @@ jobs:
|
|||||||
BITCOIN_BIN: '${{ github.workspace }}\build\bin\Release\bitcoin.exe'
|
BITCOIN_BIN: '${{ github.workspace }}\build\bin\Release\bitcoin.exe'
|
||||||
BITCOIND: '${{ github.workspace }}\build\bin\Release\bitcoind.exe'
|
BITCOIND: '${{ github.workspace }}\build\bin\Release\bitcoind.exe'
|
||||||
BITCOINCLI: '${{ github.workspace }}\build\bin\Release\bitcoin-cli.exe'
|
BITCOINCLI: '${{ github.workspace }}\build\bin\Release\bitcoin-cli.exe'
|
||||||
|
BITCOIN_BENCH: '${{ github.workspace }}\build\bin\Release\bench_bitcoin.exe'
|
||||||
BITCOINTX: '${{ github.workspace }}\build\bin\Release\bitcoin-tx.exe'
|
BITCOINTX: '${{ github.workspace }}\build\bin\Release\bitcoin-tx.exe'
|
||||||
BITCOINUTIL: '${{ github.workspace }}\build\bin\Release\bitcoin-util.exe'
|
BITCOINUTIL: '${{ github.workspace }}\build\bin\Release\bitcoin-util.exe'
|
||||||
BITCOINWALLET: '${{ github.workspace }}\build\bin\Release\bitcoin-wallet.exe'
|
BITCOINWALLET: '${{ github.workspace }}\build\bin\Release\bitcoin-wallet.exe'
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ function(create_test_config)
|
|||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
set_configure_variable(ENABLE_WALLET ENABLE_WALLET)
|
set_configure_variable(ENABLE_WALLET ENABLE_WALLET)
|
||||||
|
set_configure_variable(BUILD_BENCH BUILD_BENCH)
|
||||||
set_configure_variable(BUILD_CLI BUILD_BITCOIN_CLI)
|
set_configure_variable(BUILD_CLI BUILD_BITCOIN_CLI)
|
||||||
set_configure_variable(BUILD_TX BUILD_BITCOIN_TX)
|
set_configure_variable(BUILD_TX BUILD_BITCOIN_TX)
|
||||||
set_configure_variable(BUILD_UTIL BUILD_BITCOIN_UTIL)
|
set_configure_variable(BUILD_UTIL BUILD_BITCOIN_UTIL)
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ RPCAUTH=@abs_top_srcdir@/share/rpcauth/rpcauth.py
|
|||||||
[components]
|
[components]
|
||||||
# Which components are enabled. These are commented out by cmake if they were disabled during configuration.
|
# Which components are enabled. These are commented out by cmake if they were disabled during configuration.
|
||||||
@ENABLE_WALLET_TRUE@ENABLE_WALLET=true
|
@ENABLE_WALLET_TRUE@ENABLE_WALLET=true
|
||||||
|
@BUILD_BENCH_TRUE@BUILD_BENCH=true
|
||||||
@BUILD_BITCOIN_CLI_TRUE@ENABLE_CLI=true
|
@BUILD_BITCOIN_CLI_TRUE@ENABLE_CLI=true
|
||||||
@BUILD_BITCOIN_TX_TRUE@BUILD_BITCOIN_TX=true
|
@BUILD_BITCOIN_TX_TRUE@BUILD_BITCOIN_TX=true
|
||||||
@BUILD_BITCOIN_UTIL_TRUE@ENABLE_BITCOIN_UTIL=true
|
@BUILD_BITCOIN_UTIL_TRUE@ENABLE_BITCOIN_UTIL=true
|
||||||
|
|||||||
@@ -943,6 +943,11 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
|||||||
if not self.is_bitcoin_chainstate_compiled():
|
if not self.is_bitcoin_chainstate_compiled():
|
||||||
raise SkipTest("bitcoin-chainstate has not been 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):
|
def skip_if_no_cli(self):
|
||||||
"""Skip the running test if bitcoin-cli has not been compiled."""
|
"""Skip the running test if bitcoin-cli has not been compiled."""
|
||||||
if not self.is_cli_compiled():
|
if not self.is_cli_compiled():
|
||||||
@@ -976,6 +981,10 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
|||||||
if self.options.valgrind:
|
if self.options.valgrind:
|
||||||
raise SkipTest("This test is not compatible with 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):
|
def is_cli_compiled(self):
|
||||||
"""Checks whether bitcoin-cli was compiled."""
|
"""Checks whether bitcoin-cli was compiled."""
|
||||||
return self.config["components"].getboolean("ENABLE_CLI")
|
return self.config["components"].getboolean("ENABLE_CLI")
|
||||||
|
|||||||
@@ -261,6 +261,10 @@ class Binaries:
|
|||||||
# Add -nonamed because "bitcoin rpc" enables -named by default, but bitcoin-cli doesn't
|
# Add -nonamed because "bitcoin rpc" enables -named by default, but bitcoin-cli doesn't
|
||||||
return self._argv("rpc", self.paths.bitcoincli) + ["-nonamed"]
|
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):
|
def tx_argv(self):
|
||||||
"Return argv array that should be used to invoke bitcoin-tx"
|
"Return argv array that should be used to invoke bitcoin-tx"
|
||||||
return self._argv("tx", self.paths.bitcointx)
|
return self._argv("tx", self.paths.bitcointx)
|
||||||
@@ -301,6 +305,7 @@ def get_binary_paths(config):
|
|||||||
binaries = {
|
binaries = {
|
||||||
"bitcoin": "BITCOIN_BIN",
|
"bitcoin": "BITCOIN_BIN",
|
||||||
"bitcoind": "BITCOIND",
|
"bitcoind": "BITCOIND",
|
||||||
|
"bench_bitcoin": "BITCOIN_BENCH",
|
||||||
"bitcoin-cli": "BITCOINCLI",
|
"bitcoin-cli": "BITCOINCLI",
|
||||||
"bitcoin-util": "BITCOINUTIL",
|
"bitcoin-util": "BITCOINUTIL",
|
||||||
"bitcoin-tx": "BITCOINTX",
|
"bitcoin-tx": "BITCOINTX",
|
||||||
|
|||||||
Reference in new issue
Block a user