1
1
mirror of https://github.com/bitcoin/bitcoin synced 2025-10-06 02:12:56 +02:00

test: add is_ipc_compiled() and skip_if_no_ipc() functions

Expose ENABLE_IPC build option to functional tests so new tests can test
IPC-only features.
This commit is contained in:
Ryan Ofsky
2024-11-26 22:53:46 -05:00
committed by Pieter Wuille
parent 37c21ebe40
commit 8c7f005629
3 changed files with 11 additions and 0 deletions

View File

@@ -26,6 +26,7 @@ function(create_test_config)
set_configure_variable(WITH_ZMQ ENABLE_ZMQ)
set_configure_variable(ENABLE_EXTERNAL_SIGNER ENABLE_EXTERNAL_SIGNER)
set_configure_variable(WITH_USDT ENABLE_USDT_TRACEPOINTS)
set_configure_variable(ENABLE_IPC ENABLE_IPC)
configure_file(config.ini.in config.ini USE_SOURCE_PERMISSIONS @ONLY)
endfunction()

View File

@@ -26,3 +26,4 @@ RPCAUTH=@abs_top_srcdir@/share/rpcauth/rpcauth.py
@ENABLE_ZMQ_TRUE@ENABLE_ZMQ=true
@ENABLE_EXTERNAL_SIGNER_TRUE@ENABLE_EXTERNAL_SIGNER=true
@ENABLE_USDT_TRACEPOINTS_TRUE@ENABLE_USDT_TRACEPOINTS=true
@ENABLE_IPC_TRUE@ENABLE_IPC=true

View File

@@ -1016,6 +1016,11 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
if not self.is_cli_compiled():
raise SkipTest("bitcoin-cli has not been compiled.")
def skip_if_no_ipc(self):
"""Skip the running test if ipc is not compiled."""
if not self.is_ipc_compiled():
raise SkipTest("ipc has not been compiled.")
def skip_if_no_previous_releases(self):
"""Skip the running test if previous releases are not available."""
if not self.has_previous_releases():
@@ -1075,6 +1080,10 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
"""Checks whether the USDT tracepoints were compiled."""
return self.config["components"].getboolean("ENABLE_USDT_TRACEPOINTS")
def is_ipc_compiled(self):
"""Checks whether ipc was compiled."""
return self.config["components"].getboolean("ENABLE_IPC")
def has_blockfile(self, node, filenum: str):
return (node.blocks_path/ f"blk{filenum}.dat").is_file()