Skip to content

Commit 8298e49

Browse files
committed
build: build app tests by default
1 parent 57d1b86 commit 8298e49

3 files changed

Lines changed: 19 additions & 4 deletions

File tree

.github/workflows/depends-build.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,18 @@ jobs:
143143
cmake -S . -B "${BUILD_DIR}" -G Ninja \
144144
-DCMAKE_BUILD_TYPE=Release \
145145
-DCMAKE_TOOLCHAIN_FILE="${PWD}/bitcoin/depends/${HOST}/toolchain.cmake" \
146-
-DBUILD_APP_TESTS=OFF \
146+
-DBUILD_APP_TESTS=ON \
147147
-DBUILD_GUI=ON \
148148
-DENABLE_WALLET=ON \
149149
-DENABLE_IPC=OFF
150150
151-
- name: Build bitcoin-core-app
151+
- name: Build
152152
run: |
153-
cmake --build "${BUILD_DIR}" --target bitcoin-core-app --parallel "${JOBS}"
153+
cmake --build "${BUILD_DIR}" --parallel "${JOBS}"
154+
155+
- name: Run app tests
156+
run: |
157+
ctest --test-dir "${BUILD_DIR}" --output-on-failure --parallel "${JOBS}"
154158
155159
- name: Upload depends logs
156160
uses: actions/upload-artifact@v4

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ target_link_libraries(bitcoin-core-app
188188
)
189189
qt6_import_qml_plugins(bitcoin-core-app)
190190

191-
option(BUILD_APP_TESTS "Build unit tests for the app" OFF)
191+
option(BUILD_APP_TESTS "Build tests for the app" ON)
192192
if(BUILD_APP_TESTS)
193193
include(CTest)
194194
enable_testing()

test/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,14 @@ target_include_directories(bitcoinqml_qmltests
100100
)
101101

102102
add_test(NAME bitcoinqml_qmltests COMMAND bitcoinqml_qmltests -platform offscreen)
103+
104+
get_target_property(qt_lib_type Qt6::Core TYPE)
105+
if(qt_lib_type STREQUAL "STATIC_LIBRARY")
106+
qt6_import_plugins(bitcoinqml_unit_tests INCLUDE Qt6::QOffscreenIntegrationPlugin)
107+
qt6_import_plugins(bitcoinqml_qmltests INCLUDE Qt6::QOffscreenIntegrationPlugin)
108+
qt6_import_qml_plugins(bitcoinqml_qmltests)
109+
target_link_libraries(bitcoinqml_qmltests PRIVATE
110+
Qt6::qmlsettingsplugin
111+
Qt6::qtquickdialogsplugin
112+
)
113+
endif()

0 commit comments

Comments
 (0)