diff options
Diffstat (limited to 'tests/ECMPoQmToolsTest')
-rw-r--r-- | tests/ECMPoQmToolsTest/CMakeLists.txt | 22 | ||||
-rw-r--r-- | tests/ECMPoQmToolsTest/check_tree.cmake.in | 55 | ||||
-rw-r--r-- | tests/ECMPoQmToolsTest/po/es/install-test.po | 18 | ||||
-rw-r--r-- | tests/ECMPoQmToolsTest/po/fr/install-test.po | 18 | ||||
-rw-r--r-- | tests/ECMPoQmToolsTest/test.po | 18 |
5 files changed, 131 insertions, 0 deletions
diff --git a/tests/ECMPoQmToolsTest/CMakeLists.txt b/tests/ECMPoQmToolsTest/CMakeLists.txt new file mode 100644 index 00000000..eabf2b88 --- /dev/null +++ b/tests/ECMPoQmToolsTest/CMakeLists.txt @@ -0,0 +1,22 @@ +project(ECMPoQmToolsTest) +cmake_minimum_required(VERSION 2.8.12) +set(ECM_MODULE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../modules") + +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../modules) + +# make sure the test install dir is clean +file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}") + +include(ECMPoQmTools) + +ecm_create_qm_loader(QMLOADER_PATH catalog) + +ecm_process_po_files_as_qm(fr ALL + INSTALL_DESTINATION share/locale + PO_FILES test.po +) + +ecm_install_po_files_as_qm(po) + +# this will be run by CTest +configure_file(check_tree.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/check_tree.cmake" @ONLY) diff --git a/tests/ECMPoQmToolsTest/check_tree.cmake.in b/tests/ECMPoQmToolsTest/check_tree.cmake.in new file mode 100644 index 00000000..71cbaa8d --- /dev/null +++ b/tests/ECMPoQmToolsTest/check_tree.cmake.in @@ -0,0 +1,55 @@ +set(BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@") +set(ACTUAL_TREE "@CMAKE_INSTALL_PREFIX@") +set(QMLOADER_PATH "@QMLOADER_PATH@") + +set(fail OFF) + +macro(mark_failed msg) + message(WARNING "FAIL: ${msg}") + set(fail ON) +endmacro() + +macro(check_strequal var expected) + if (NOT "${${var}}" STREQUAL "${expected}") + mark_failed("${var} is:\n \"${${var}}\"\nExpected:\n \"${expected}\"") + endif() +endmacro() + +macro(check_exists file) + if (NOT EXISTS ${file}) + mark_failed("File \"${file}\" does not exist") + endif() +endmacro() + +check_exists(${BINARY_DIR}/ECMQmLoader.cpp) +check_strequal(QMLOADER_PATH "${BINARY_DIR}/ECMQmLoader.cpp") + +set(exp_files + "share/locale/fr/LC_MESSAGES/test.qm" + "share/locale/fr/LC_MESSAGES/install-test.qm" + "share/locale/es/LC_MESSAGES/install-test.qm" +) +file(GLOB_RECURSE actual_files RELATIVE "${ACTUAL_TREE}" "${ACTUAL_TREE}/*") +list(SORT exp_files) +list(SORT actual_files) + +if(NOT exp_files STREQUAL actual_files) + foreach(f ${exp_files}) + list(FIND actual_files "${f}" result) + if(result EQUAL -1) + message(WARNING "${f} was expected, but not found") + set(fail ON) + endif() + endforeach() + foreach(f ${actual_files}) + list(FIND exp_files "${f}" result) + if(result EQUAL -1) + message(WARNING "${f} was found, but not expected") + set(fail ON) + endif() + endforeach() +endif() + +if (fail) + message("Test failed!") +endif() diff --git a/tests/ECMPoQmToolsTest/po/es/install-test.po b/tests/ECMPoQmToolsTest/po/es/install-test.po new file mode 100644 index 00000000..107d1b08 --- /dev/null +++ b/tests/ECMPoQmToolsTest/po/es/install-test.po @@ -0,0 +1,18 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Language: fr\n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Qt-Contexts: true\n" +"X-Generator: Poedit 1.5.4\n" + +#: ../../home/aurelien/src/kf5/frameworks/kbookmarks/src/kbookmark.cpp:307 +msgctxt "KBookmark|Bookmark separator" +msgid "--- separator ---" +msgstr "" diff --git a/tests/ECMPoQmToolsTest/po/fr/install-test.po b/tests/ECMPoQmToolsTest/po/fr/install-test.po new file mode 100644 index 00000000..107d1b08 --- /dev/null +++ b/tests/ECMPoQmToolsTest/po/fr/install-test.po @@ -0,0 +1,18 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Language: fr\n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Qt-Contexts: true\n" +"X-Generator: Poedit 1.5.4\n" + +#: ../../home/aurelien/src/kf5/frameworks/kbookmarks/src/kbookmark.cpp:307 +msgctxt "KBookmark|Bookmark separator" +msgid "--- separator ---" +msgstr "" diff --git a/tests/ECMPoQmToolsTest/test.po b/tests/ECMPoQmToolsTest/test.po new file mode 100644 index 00000000..107d1b08 --- /dev/null +++ b/tests/ECMPoQmToolsTest/test.po @@ -0,0 +1,18 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Language: fr\n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Qt-Contexts: true\n" +"X-Generator: Poedit 1.5.4\n" + +#: ../../home/aurelien/src/kf5/frameworks/kbookmarks/src/kbookmark.cpp:307 +msgctxt "KBookmark|Bookmark separator" +msgid "--- separator ---" +msgstr "" |