┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/tests/CMakeLists.txt
diff options
context:
space:
mode:
authorAdriaan de Groot <[email protected]>2020-05-28 23:39:52 +0200
committerAdriaan de Groot <[email protected]>2020-05-28 23:39:52 +0200
commitd3963a7765a5a85ff3a07fb8eedc12f2d92d9383 (patch)
tree0d6e326e744b077ed7d40ef17c909965b1907b39 /src/tests/CMakeLists.txt
parent0d679da0a378198310d18bfbe5d50ede9b64a452 (diff)
Make ruby, and Gem:test-unit, optional
While this reduces test-coverage in cases where the user doesn't have Ruby or the testing gem installed, it at least allows us to get through configure and build without disabling **all** testing.
Diffstat (limited to 'src/tests/CMakeLists.txt')
-rw-r--r--src/tests/CMakeLists.txt16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index 8d4498675..d1c25a2b8 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -3,11 +3,7 @@ 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.")
+include(FindGem) # For servicemenutest, see bottom of this file
# KItemSetTest
ecm_add_test(kitemsettest.cpp LINK_LIBRARIES dolphinprivate Qt5::Test)
@@ -84,5 +80,11 @@ if (KF5_VERSION VERSION_GREATER_EQUAL 5.63.0)
LINK_LIBRARIES dolphinprivate dolphinstatic Qt5::Test)
endif()
-add_test(NAME servicemenutest
- COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../settings/services/test/test_run.rb)
+find_gem(test-unit)
+set_package_properties(Gem:test-unit PROPERTIES
+ TYPE RECOMMENDED
+ DESCRIPTION "Ruby gem 'test-unit' required for testing of servicemenu helpers.")
+if (Gem:test-unit_FOUND)
+ add_test(NAME servicemenutest
+ COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../settings/services/test/test_run.rb)
+endif()