mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-12 07:41:21 +02:00
cmake: Build test_bitcoin-qt
executable
This commit is contained in:
@ -243,6 +243,10 @@ if(WIN32)
|
||||
set_target_properties(bitcoin-qt PROPERTIES WIN32_EXECUTABLE TRUE)
|
||||
endif()
|
||||
|
||||
if(BUILD_GUI_TESTS)
|
||||
add_subdirectory(test)
|
||||
endif()
|
||||
|
||||
|
||||
# Gets sources to be parsed to gather translatable strings.
|
||||
function(get_translatable_sources var)
|
||||
|
56
src/qt/test/CMakeLists.txt
Normal file
56
src/qt/test/CMakeLists.txt
Normal file
@ -0,0 +1,56 @@
|
||||
# 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()
|
||||
|
||||
add_test(NAME test_bitcoin-qt
|
||||
COMMAND test_bitcoin-qt
|
||||
)
|
||||
if(WIN32 AND VCPKG_TARGET_TRIPLET)
|
||||
# On Windows, vcpkg configures Qt with `-opengl dynamic`, which makes
|
||||
# the "minimal" platform plugin unusable due to internal Qt bugs.
|
||||
set_tests_properties(test_bitcoin-qt PROPERTIES
|
||||
ENVIRONMENT "QT_QPA_PLATFORM=windows"
|
||||
)
|
||||
endif()
|
||||
|
||||
install(TARGETS test_bitcoin-qt
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
Reference in New Issue
Block a user