Commit feb284c3 authored by Laurent Montel's avatar Laurent Montel 😁

Allow to run test without install it

parent ba5fc430
...@@ -5,7 +5,15 @@ project(KIMAP VERSION ${PIM_VERSION}) ...@@ -5,7 +5,15 @@ project(KIMAP VERSION ${PIM_VERSION})
# ECM setup # ECM setup
set(KF5_VERSION "5.37.0") set(KF5_VERSION "5.37.0")
find_package(ECM ${KF5_VERSION} CONFIG REQUIRED) option(RUN_UNINSTALL "test run uninstalled apps (experimental)" FALSE)
set(ECM_VERSION ${KF5_VERSION})
# ECM setup
if (RUN_UNINSTALL)
set(ECM_VERSION "5.38.0")
endif()
find_package(ECM ${ECM_VERSION} CONFIG REQUIRED)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${KIMAP_SOURCE_DIR}/cmake) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${KIMAP_SOURCE_DIR}/cmake)
include(GenerateExportHeader) include(GenerateExportHeader)
......
...@@ -9,7 +9,7 @@ add_subdirectory(kimaptest) ...@@ -9,7 +9,7 @@ add_subdirectory(kimaptest)
macro(KIMAP_UNIT_TESTS) macro(KIMAP_UNIT_TESTS)
foreach(_testname ${ARGN}) foreach(_testname ${ARGN})
add_executable(${_testname} ${_testname}.cpp) add_executable(${_testname} ${_testname}.cpp)
add_test(${_testname} ${_testname}) add_test(NAME ${_testname} COMMAND ${_testname})
ecm_mark_as_test(${_testname}) ecm_mark_as_test(${_testname})
target_link_libraries(${_testname} KF5IMAP Qt5::Test kimaptest Qt5::Network) target_link_libraries(${_testname} KF5IMAP Qt5::Test kimaptest Qt5::Network)
set_target_properties(${_testname} PROPERTIES COMPILE_FLAGS -DTEST_DATA="\\"${CMAKE_CURRENT_SOURCE_DIR}\\"") set_target_properties(${_testname} PROPERTIES COMPILE_FLAGS -DTEST_DATA="\\"${CMAKE_CURRENT_SOURCE_DIR}\\"")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment