]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/tests/CMakeLists.txt
find ruby gems & make coverage conditional on BUILD_COVERAGE
[dolphin.git] / src / tests / CMakeLists.txt
index f29ae53d42de215c8678cc0cf8e5470c2671752c..8ef20cb83b7bfc04f95164d6daa0cf1468de21a6 100644 (file)
@@ -3,6 +3,18 @@ set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
 find_package(Qt5Test CONFIG REQUIRED)
 include(ECMAddTests)
 
+include(FindGem)
+
+find_gem(test-unit REQUIRED)
+set_package_properties(Gem:test-unit PROPERTIES
+    DESCRIPTION "Ruby gem 'test-unit' required for testing of servicemenu helpers.")
+
+if(BUILD_COVERAGE)
+    find_gem(simplecov)
+    set_package_properties(Gem:simplecov PROPERTIES
+        DESCRIPTION "Ruby gem 'simplecov' used for coverage statistics.")
+endif()
+
 # KItemSetTest
 ecm_add_test(kitemsettest.cpp LINK_LIBRARIES dolphinprivate Qt5::Test)
 
@@ -14,35 +26,22 @@ ecm_add_test(kitemrangetest.cpp LINK_LIBRARIES dolphinprivate Qt5::Test)
 ecm_add_test(kitemlistselectionmanagertest.cpp LINK_LIBRARIES dolphinprivate Qt5::Test)
 
 # KItemListControllerTest
-
-kconfig_add_kcfg_files(kitemlistcontrollertest_SRCS GENERATE_MOC
-    ../settings/dolphin_generalsettings.kcfgc
-)
-ecm_add_test(kitemlistcontrollertest.cpp testdir.cpp ../dolphindebug.cpp ${kitemlistcontrollertest_SRCS}
+ecm_add_test(kitemlistcontrollertest.cpp testdir.cpp
 TEST_NAME kitemlistcontrollertest
 LINK_LIBRARIES dolphinprivate Qt5::Test)
 
 # KFileItemListViewTest
-kconfig_add_kcfg_files(kfileitemlistviewtest_SRCS GENERATE_MOC
-    ../settings/dolphin_generalsettings.kcfgc
-)
-ecm_add_test(kfileitemlistviewtest.cpp testdir.cpp ../dolphindebug.cpp ${kfileitemlistviewtest_SRCS}
+ecm_add_test(kfileitemlistviewtest.cpp testdir.cpp
 TEST_NAME kfileitemlistviewtest
 LINK_LIBRARIES dolphinprivate Qt5::Test)
 
 # KFileItemModelTest
-kconfig_add_kcfg_files(kfileitemmodeltest_SRCS GENERATE_MOC
-    ../settings/dolphin_generalsettings.kcfgc
-)
-ecm_add_test(kfileitemmodeltest.cpp testdir.cpp ../dolphindebug.cpp ${kfileitemmodeltest_SRCS}
+ecm_add_test(kfileitemmodeltest.cpp testdir.cpp
 TEST_NAME kfileitemmodeltest
-LINK_LIBRARIES dolphinprivate Qt5::Test)
+LINK_LIBRARIES dolphinprivate dolphinstatic Qt5::Test)
 
 # KFileItemModelBenchmark
-kconfig_add_kcfg_files(kfileitemmodelbenchmark_SRCS GENERATE_MOC
-    ../settings/dolphin_generalsettings.kcfgc
-)
-ecm_add_test(kfileitemmodelbenchmark.cpp testdir.cpp ../dolphindebug.cpp ${kfileitemmodelbenchmark_SRCS}
+ecm_add_test(kfileitemmodelbenchmark.cpp testdir.cpp
 TEST_NAME kfileitemmodelbenchmark
 LINK_LIBRARIES  dolphinprivate Qt5::Test)
 
@@ -51,24 +50,36 @@ ecm_add_test(kitemlistkeyboardsearchmanagertest.cpp LINK_LIBRARIES dolphinprivat
 
 # DolphinSearchBox
 if (KF5Baloo_FOUND)
-  kconfig_add_kcfg_files(dolphinsearchboxtest_SRCS
-      ../search/dolphin_searchsettings.kcfgc
-  )
-  ecm_add_test(dolphinsearchboxtest.cpp ../search/dolphinfacetswidget.cpp ../search/dolphinsearchbox.cpp ${dolphinsearchboxtest_SRCS}
+  ecm_add_test(dolphinsearchboxtest.cpp
   TEST_NAME dolphinsearchboxtest
-  LINK_LIBRARIES dolphinprivate Qt5::Test)
+  LINK_LIBRARIES dolphinprivate dolphinstatic Qt5::Test)
 endif()
 
 # KStandardItemModelTest
-ecm_add_test(kstandarditemmodeltest.cpp ../dolphindebug.cpp
+ecm_add_test(kstandarditemmodeltest.cpp
 TEST_NAME kstandarditemmodeltest
-LINK_LIBRARIES dolphinprivate Qt5::Test)
+LINK_LIBRARIES dolphinprivate dolphinstatic Qt5::Test)
 
 # ViewPropertiesTest
-kconfig_add_kcfg_files(viewpropertiestest_SRCS GENERATE_MOC
-  ../settings/dolphin_generalsettings.kcfgc
-  ../settings/dolphin_directoryviewpropertysettings.kcfgc
-)
-ecm_add_test(viewpropertiestest.cpp testdir.cpp ../dolphindebug.cpp ${viewpropertiestest_SRCS}
+ecm_add_test(viewpropertiestest.cpp testdir.cpp
 TEST_NAME viewpropertiestest
-LINK_LIBRARIES dolphinprivate Qt5::Test)
+LINK_LIBRARIES dolphinprivate dolphinstatic Qt5::Test)
+
+# DolphinMainWindowTest
+set(dolphinmainwindowtest_SRCS dolphinmainwindowtest.cpp)
+qt5_add_resources(dolphinmainwindowtest_SRCS ${CMAKE_SOURCE_DIR}/src/dolphin.qrc)
+
+ecm_add_test(${dolphinmainwindowtest_SRCS}
+TEST_NAME dolphinmainwindowtest
+LINK_LIBRARIES dolphinprivate dolphinstatic Qt5::Test)
+
+# DragAndDropHelperTest
+ecm_add_test(draganddrophelpertest.cpp LINK_LIBRARIES dolphinprivate Qt5::Test)
+
+# PlacesItemModelTest
+ecm_add_test(placesitemmodeltest.cpp
+TEST_NAME placesitemmodeltest
+LINK_LIBRARIES dolphinprivate dolphinstatic Qt5::Test)
+
+add_test(NAME servicemenutest
+ COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../settings/services/test/test_run.rb)