From 16aabe1c24b5471d4dc6eb04ed6d0b654e40996d Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Sat, 8 Apr 2017 16:05:41 +0200 Subject: 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 --- tests/CMakeLists.txt | 1 + tests/KDEFetchTranslations/CMakeLists.txt | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 tests/KDEFetchTranslations/CMakeLists.txt (limited to 'tests') 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() -- cgit v1.2.1