summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-08-17 07:37:01 +0200
committerMontel Laurent <[email protected]>2017-08-17 07:37:01 +0200
commit3455e85a5e2b2ec824b368d54c25fec6f1f14a99 (patch)
tree068f1fa3ec46d70f1c9aef87e0b04b741dcc1163
parent6b15c7f41e343e0b265adce8d555da55865db64f (diff)
Fix execute autotest without install them
-rw-r--r--CMakeLists.txt10
-rw-r--r--noteshared/autotests/CMakeLists.txt2
-rw-r--r--noteshared/src/attributes/autotests/CMakeLists.txt2
-rw-r--r--src/print/autotests/CMakeLists.txt2
4 files changed, 12 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3c93010..60e7360 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,7 +3,15 @@ project(knotes)
cmake_minimum_required(VERSION 3.1)
set(KF5_VERSION "5.37.0")
-find_package(ECM ${KF5_VERSION} REQUIRED NO_MODULE)
+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 ${knotes_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH})
include(ECMInstallIcons)
diff --git a/noteshared/autotests/CMakeLists.txt b/noteshared/autotests/CMakeLists.txt
index d2d2063..8c90c52 100644
--- a/noteshared/autotests/CMakeLists.txt
+++ b/noteshared/autotests/CMakeLists.txt
@@ -1,4 +1,4 @@
add_executable(noteeditorutilstest noteeditorutilstest.cpp )
-add_test(noteeditorutilstest noteeditorutilstest)
+add_test(NAME noteeditorutilstest COMMAND noteeditorutilstest)
ecm_mark_as_test(noteeditorutilstest)
target_link_libraries(noteeditorutilstest Qt5::Test notesharedprivate)
diff --git a/noteshared/src/attributes/autotests/CMakeLists.txt b/noteshared/src/attributes/autotests/CMakeLists.txt
index eea0b94..c738b3a 100644
--- a/noteshared/src/attributes/autotests/CMakeLists.txt
+++ b/noteshared/src/attributes/autotests/CMakeLists.txt
@@ -6,7 +6,7 @@ macro(add_noteshared_unittest _source)
set(_test ${_source})
get_filename_component(_name ${_source} NAME_WE)
add_executable( ${_name} ${_test} )
- add_test( ${_name} ${_name} )
+ add_test(NAME ${_name} COMMAND ${_name} )
ecm_mark_as_test(noteshared-${_name})
target_link_libraries( ${_name}
notesharedprivate
diff --git a/src/print/autotests/CMakeLists.txt b/src/print/autotests/CMakeLists.txt
index 5672728..7215d13 100644
--- a/src/print/autotests/CMakeLists.txt
+++ b/src/print/autotests/CMakeLists.txt
@@ -4,7 +4,7 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/
set( knotes_knotesgrantleeprint_source knotesgrantleeprinttest.cpp )
add_executable( knotesgrantleeprinttest ${knotes_knotesgrantleeprint_source})
-add_test(knotesgrantleeprinttest knotesgrantleeprinttest)
+add_test(NAME knotesgrantleeprinttest COMMAND knotesgrantleeprinttest)
ecm_mark_as_test(knotesgrantleeprinttest)
target_link_libraries( knotesgrantleeprinttest Qt5::Test Qt5::Gui KF5::AkonadiCore knotesprivate KF5::Mime KF5::AkonadiNotes Grantlee5::Templates KF5::PimCommon)