forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge #101: cmake: Build
test_bitcoin-qt
executable
e4b4c98 fixup! cmake: Migrate Guix build scripts to CMake (Hennadii Stepanov) 0be2225 cmake: Build `test_bitcoin-qt` executable (Hennadii Stepanov) 4da7634 fixup! cmake: Build `bitcoin-qt` executable (Hennadii Stepanov) Pull request description: A new configuration option is `BUILD_GUI_TESTS`. --- **Native Windows / MSVC Notes:** 1. vcpkg configures Qt with `-opengl dynamic`, which makes the "minimal" platform plugin unusable due to internal Qt bugs. 2. `ctest` workarounds this issue by setting the environment variable `QT_QPA_PLATFORM=windows`. 3. This approach works nice in the CI for both `x64-windows` and `x64-windows-static` triplets. Please note that `test_bitcoin-qt.exe` fails to run in the CI environment on the master branch. 4. One who is willing to debug Qt with the "minimal" platform plugin could run the `test_bitcoin-qt.exe` directly (not driven by `ctest`). ACKs for top commit: pablomartin4btc: re tACK e4b4c98 Tree-SHA512: 638de710aa722a168b9944089062b2da43f9f14cb0684acb8fc5922907e96b1e4d8c04c852826275d5cbbbd824a1f2905d550bdf5355cef9f22738414e7fbd6e
- Loading branch information
Showing
6 changed files
with
88 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Copyright (c) 2024-present The Bitcoin Core developers | ||
# Distributed under the MIT software license, see the accompanying | ||
# file COPYING or https://opensource.org/license/mit/. | ||
|
||
add_executable(test_bitcoin-qt | ||
apptests.cpp | ||
optiontests.cpp | ||
rpcnestedtests.cpp | ||
test_main.cpp | ||
uritests.cpp | ||
util.cpp | ||
../../init/bitcoin-qt.cpp | ||
) | ||
|
||
target_link_libraries(test_bitcoin-qt | ||
core_interface | ||
bitcoinqt | ||
test_util | ||
bitcoin_node | ||
Boost::headers | ||
Qt5::Test | ||
) | ||
|
||
import_plugins(test_bitcoin-qt) | ||
|
||
if(ENABLE_WALLET) | ||
target_sources(test_bitcoin-qt | ||
PRIVATE | ||
addressbooktests.cpp | ||
wallettests.cpp | ||
../../wallet/test/wallet_test_fixture.cpp | ||
) | ||
endif() | ||
|
||
if(NOT QT_IS_STATIC) | ||
add_custom_command( | ||
TARGET test_bitcoin-qt POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_PROPERTY:Qt5::QMinimalIntegrationPlugin,LOCATION_$<UPPER_CASE:$<CONFIG>>> $<TARGET_FILE_DIR:test_bitcoin-qt>/plugins/platforms | ||
VERBATIM | ||
) | ||
endif() | ||
|
||
install(TARGETS test_bitcoin-qt | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
COMPONENT GUI | ||
) |