File tree 3 files changed +18
-2
lines changed
3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change
1
+ # common CMake macro for linuxdeploy, adding tests only if they are supposed to be built
2
+ # otherwise if you try to run CTest the tests aren't build and CTest can't find them
3
+ if (NOT COMMAND ld_add_test)
4
+ function (ld_add_test TARGET_NAME)
5
+ get_target_property (${TARGET_NAME} _EFA ${TARGET_NAME} EXCLUDE_FROM_ALL )
6
+ if (NOT ${${TARGET_NAME} _EXCLUDE_FROM_ALL})
7
+ message (STATUS "[${PROJECT_NAME} ] Adding test ${TARGET_NAME} " )
8
+ add_test (${TARGET_NAME} ${TARGET_NAME} )
9
+ else ()
10
+ message (STATUS "[${PROJECT_NAME} ] Test ${TARGET_NAME} is excluded from ALL, not adding as test" )
11
+ endif ()
12
+ endfunction ()
13
+ endif ()
14
+
1
15
add_executable (linuxdeploy-plugin-qt-tests test_main.cpp test_deploy_qml.cpp ../src/qml.cpp)
2
16
target_link_libraries (linuxdeploy-plugin-qt-tests linuxdeploy_core args json gtest)
3
17
target_compile_definitions (linuxdeploy-plugin-qt-tests PRIVATE TESTS_DATA_DIR="${CMAKE_CURRENT_SOURCE_DIR} /data" )
4
18
5
- add_test (linuxdeploy-plugin-qt-tests linuxdeploy-plugin-qt-tests)
19
+ ld_add_test (linuxdeploy-plugin-qt-tests linuxdeploy-plugin-qt-tests)
6
20
Original file line number Diff line number Diff line change @@ -39,6 +39,8 @@ cmake "$REPO_ROOT" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo
39
39
40
40
make -j$( nproc)
41
41
42
+ ctest -V
43
+
42
44
make install DESTDIR=AppDir
43
45
44
46
strip_path=$( which strip)
You can’t perform that action at this time.
0 commit comments