aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAleix Pol <aleixpol@kde.org>2017-04-08 16:05:41 +0200
committerAleix Pol <aleixpol@kde.org>2017-04-10 15:01:16 +0200
commit16aabe1c24b5471d4dc6eb04ed6d0b654e40996d (patch)
tree51350303d52343a90b47111df2634c3b09f55cd1 /tests
parent3d1d436da60a32e0ab5bec3e09173c4f865ec3f6 (diff)
downloadextra-cmake-modules-16aabe1c24b5471d4dc6eb04ed6d0b654e40996d.tar.gz
extra-cmake-modules-16aabe1c24b5471d4dc6eb04ed6d0b654e40996d.tar.bz2
Add a test for _repository_name() a function added for fetch-translations
Summary: It turns out it's more complex than it looks, it's always better to have tests. Reviewers: sitter, aacid Reviewed By: sitter Subscribers: #frameworks, #build_system Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D5352
Diffstat (limited to 'tests')
-rw-r--r--tests/CMakeLists.txt1
-rw-r--r--tests/KDEFetchTranslations/CMakeLists.txt27
2 files changed, 28 insertions, 0 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 88975499..965defad 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -112,6 +112,7 @@ endif()
add_test_macro(ExecuteCoreModules dummy)
add_test_macro(ExecuteKDEModules dummy)
+add_test_macro(KDEFetchTranslations dummy)
add_test_macro(KDEInstallDirsTest.relative_or_absolute dummy)
add_test_variant(KDEInstallDirsTest.vars_in_sync_no_args
diff --git a/tests/KDEFetchTranslations/CMakeLists.txt b/tests/KDEFetchTranslations/CMakeLists.txt
new file mode 100644
index 00000000..b5f4083b
--- /dev/null
+++ b/tests/KDEFetchTranslations/CMakeLists.txt
@@ -0,0 +1,27 @@
+project(KDEFetchTranslations)
+cmake_minimum_required(VERSION 2.8.12)
+
+# order is important (install dirs before cmake settings)!
+set(all_kde_modules
+ KDEInstallDirs
+ KDECMakeSettings
+)
+
+set(ECM_KDE_MODULE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../kde-modules)
+set(ECM_MODULE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../modules)
+set(CMAKE_MODULE_PATH "${ECM_KDE_MODULE_DIR}" "${ECM_MODULE_DIR}")
+
+foreach(module ${all_kde_modules})
+ message(STATUS "module: ${module}")
+ include("${module}")
+endforeach()
+
+_repository_name(name "${CMAKE_CURRENT_SOURCE_DIR}/../../")
+if (NOT ${name} STREQUAL "extra-cmake-modules")
+ message(FATAL_ERROR "Wrong repository name: ${name}, should be 'extra-cmake-modules'")
+endif()
+add_executable(dummy ../ExecuteKDEModules/main.c)
+
+if(NOT TARGET fetch-translations)
+ message(FATAL_ERROR "should have a fetch-translations target")
+endif()