Files
bitcoin/test/CMakeLists.txt
Ava Chow 146988ef6c Merge bitcoin/bitcoin#35551: test: add interface_gui.py to test bitcoin-qt startup
aa01721c89 test: add interface_gui.py to test bitcoin-gui startup via RPC (Ryan Ofsky)

Pull request description:

  Adds a functional test that starts bitcoin-qt using QT_QPA_PLATFORM=minimal for headless operation, then verifies it responds to a stop RPC call. This detects startup crashes in the GUI that have no CI coverage today like https://github.com/bitcoin-core/gui/issues/940

  The new test is currently skipped on macos and windows due to different problems on those platforms that may be resolved with future PRs. Fixing the windows issue should also allow the `tool_bitcoin.py` test to be enabled on windows, and fixing the macos issue should allow Qt addressbook and wallet tests to be enabled on macos.

ACKs for top commit:
  achow101:
    ACK aa01721c89
  sedited:
    ACK aa01721c89
  pablomartin4btc:
    ACK aa01721c89
  hebasto:
    ACK aa01721c89.

Tree-SHA512: 84873aed41a856322eca1c391d3ff19b6eb4a0aa253d09ace342e3efe970a330cb11506eb4efe2580b7991132b644c7408feb013c18dbfbfaaf879f88f12e02e
2026-07-29 11:32:46 -07:00

103 lines
3.3 KiB
CMake

# Copyright (c) 2023-present The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://opensource.org/license/mit/.
function(create_test_config)
set(abs_top_srcdir ${PROJECT_SOURCE_DIR})
set(abs_top_builddir ${PROJECT_BINARY_DIR})
set(EXEEXT ${CMAKE_EXECUTABLE_SUFFIX})
macro(set_configure_variable var conf_var)
if(${var})
set(${conf_var}_TRUE "")
else()
set(${conf_var}_TRUE "#")
endif()
endmacro()
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_TX BUILD_BITCOIN_TX)
set_configure_variable(BUILD_UTIL BUILD_BITCOIN_UTIL)
set_configure_variable(BUILD_UTIL_CHAINSTATE BUILD_BITCOIN_CHAINSTATE)
set_configure_variable(BUILD_WALLET_TOOL BUILD_BITCOIN_WALLET)
set_configure_variable(BUILD_DAEMON BUILD_BITCOIND)
set_configure_variable(BUILD_FUZZ_BINARY ENABLE_FUZZ_BINARY)
set_configure_variable(WITH_ZMQ ENABLE_ZMQ)
set_configure_variable(WITH_EMBEDDED_ASMAP ENABLE_EMBEDDED_ASMAP)
set_configure_variable(ENABLE_EXTERNAL_SIGNER ENABLE_EXTERNAL_SIGNER)
set_configure_variable(WITH_USDT ENABLE_USDT_TRACEPOINTS)
set_configure_variable(ENABLE_IPC ENABLE_IPC)
set_configure_variable(BUILD_GUI BUILD_GUI)
configure_file(config.ini.in config.ini USE_SOURCE_PERMISSIONS @ONLY)
endfunction()
create_test_config()
function(create_test_directory_links)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/functional)
file(GLOB functional
LIST_DIRECTORIES FALSE
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
functional/*.html
functional/*.py
)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/functional/data)
file(GLOB functional_data
LIST_DIRECTORIES FALSE
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
functional/data/*.json
functional/data/*.py
)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/functional/mocks)
file(GLOB functional_mocks
LIST_DIRECTORIES FALSE
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
functional/mocks/*.py
)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/functional/test_framework)
file(GLOB functional_test_framework
LIST_DIRECTORIES FALSE
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
functional/test_framework/*.csv
functional/test_framework/*.py
)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/functional/test_framework/crypto)
file(GLOB functional_test_framework_crypto
LIST_DIRECTORIES FALSE
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
functional/test_framework/crypto/*.csv
functional/test_framework/crypto/*.py
)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/fuzz)
set(files_to_link
${functional}
${functional_data}
${functional_mocks}
${functional_test_framework}
${functional_test_framework_crypto}
fuzz/test_runner.py
)
foreach(f IN LISTS files_to_link)
if(CMAKE_HOST_WIN32)
set(symlink)
else()
set(symlink SYMBOLIC)
endif()
file(CREATE_LINK ${CMAKE_CURRENT_SOURCE_DIR}/${f} ${CMAKE_CURRENT_BINARY_DIR}/${f} COPY_ON_ERROR ${symlink})
endforeach()
configure_file(${PROJECT_SOURCE_DIR}/src/test/data/siphash.json ${PROJECT_BINARY_DIR}/src/test/data/siphash.json COPYONLY)
endfunction()
create_test_directory_links()