mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-12 05:32:22 +02:00
test: add interface_gui.py to test bitcoin-gui startup via RPC
Adds a functional test that starts bitcoin-gui (via the bitcoin wrapper
with "gui" subcommand) using QT_QPA_PLATFORM=minimal for headless
operation, then verifies it responds to a stop RPC call. This catches
startup regressions in the GUI that have no CI coverage today.
Extends the test framework to support use_gui=True in TestNode, which
invokes "bitcoin gui" instead of "bitcoin node" and automatically sets
QT_QPA_PLATFORM=minimal. Adds BUILD_GUI to test/config.ini.in and
is_gui_compiled()/skip_if_no_gui() helpers to BitcoinTestFramework.
Co-Authored-By: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1078,6 +1078,11 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
||||
if not self.is_ipc_compiled():
|
||||
raise SkipTest("ipc has not been compiled.")
|
||||
|
||||
def skip_if_no_gui(self):
|
||||
"""Skip the running test if the GUI has not been compiled."""
|
||||
if not self.is_gui_compiled():
|
||||
raise SkipTest("GUI 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():
|
||||
@@ -1160,6 +1165,10 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
||||
"""Checks whether ipc was compiled."""
|
||||
return self.config["components"].getboolean("ENABLE_IPC")
|
||||
|
||||
def is_gui_compiled(self):
|
||||
"""Checks whether the GUI was compiled."""
|
||||
return self.config["components"].getboolean("BUILD_GUI", fallback=False)
|
||||
|
||||
def has_blockfile(self, node, filenum: str):
|
||||
return (node.blocks_path/ f"blk{filenum}.dat").is_file()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user