aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAurélien Gâteau <agateau@kde.org>2014-05-13 15:52:39 +0200
committerAurélien Gâteau <agateau@kde.org>2014-05-13 17:20:18 +0200
commitb02aac922797f9dbaaf35de54de61a1167984e51 (patch)
treec6d97323236613d42ecff4510b2b08aa073ebd59 /tests
parent0aef7600debb1d3d1b18aa77149c93ef118c4208 (diff)
downloadextra-cmake-modules-b02aac922797f9dbaaf35de54de61a1167984e51.tar.gz
extra-cmake-modules-b02aac922797f9dbaaf35de54de61a1167984e51.tar.bz2
More complete testing of ECMPoQmTools
- Test calling ecm_process_po_files_as_qm() without INSTALL_DESTINATION argument - Test calling ecm_install_po_files_as_qm() with CMAKE_INSTALL_LOCALEDIR set and with LOCALE_INSTALL_DIR set REVIEW: 118114
Diffstat (limited to 'tests')
-rw-r--r--tests/ECMPoQmToolsTest/CMakeLists.txt21
-rw-r--r--tests/ECMPoQmToolsTest/check_tree.cmake.in14
-rw-r--r--tests/ECMPoQmToolsTest/only-process.po (renamed from tests/ECMPoQmToolsTest/test.po)0
-rw-r--r--tests/ECMPoQmToolsTest/po-custom-dir1/es/custom-dir1-install-test.po18
-rw-r--r--tests/ECMPoQmToolsTest/po-custom-dir1/fr/custom-dir1-install-test.po18
-rw-r--r--tests/ECMPoQmToolsTest/po-custom-dir2/es/custom-dir2-install-test.po18
-rw-r--r--tests/ECMPoQmToolsTest/po-custom-dir2/fr/custom-dir2-install-test.po18
-rw-r--r--tests/ECMPoQmToolsTest/process-and-install.po18
8 files changed, 120 insertions, 5 deletions
diff --git a/tests/ECMPoQmToolsTest/CMakeLists.txt b/tests/ECMPoQmToolsTest/CMakeLists.txt
index eabf2b88..3dcb3513 100644
--- a/tests/ECMPoQmToolsTest/CMakeLists.txt
+++ b/tests/ECMPoQmToolsTest/CMakeLists.txt
@@ -9,14 +9,33 @@ file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}")
include(ECMPoQmTools)
+# Should create ${CMAKE_CURRENT_BINARY_DIR}/qmloader.cpp and set QMLOADER_PATH
+# to its path
ecm_create_qm_loader(QMLOADER_PATH catalog)
+# Should create a process-and-install.qm file and install it
ecm_process_po_files_as_qm(fr ALL
INSTALL_DESTINATION share/locale
- PO_FILES test.po
+ PO_FILES process-and-install.po
)
+# Should create a only-process.qm file, without installing it
+ecm_process_po_files_as_qm(fr ALL
+ PO_FILES only-process.po
+)
+
+# Should create a bunch of .qm files and install them in share/locale
ecm_install_po_files_as_qm(po)
+# Should create a bunch of .qm files and install them in
+# ${CMAKE_INSTALL_LOCALEDIR}
+set(CMAKE_INSTALL_LOCALEDIR custom-dir1)
+ecm_install_po_files_as_qm(po-custom-dir1)
+
+# Should create a bunch of .qm files and install them in
+# ${LOCALE_INSTALL_DIR}
+set(LOCALE_INSTALL_DIR custom-dir2)
+ecm_install_po_files_as_qm(po-custom-dir2)
+
# 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
index 71cbaa8d..9f4f7c0d 100644
--- a/tests/ECMPoQmToolsTest/check_tree.cmake.in
+++ b/tests/ECMPoQmToolsTest/check_tree.cmake.in
@@ -24,10 +24,16 @@ 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"
+check_exists(${BINARY_DIR}/fr/only-process.qm)
+
+set(exp_files
+ "share/locale/fr/LC_MESSAGES/process-and-install.qm"
"share/locale/es/LC_MESSAGES/install-test.qm"
+ "share/locale/fr/LC_MESSAGES/install-test.qm"
+ "custom-dir1/es/LC_MESSAGES/custom-dir1-install-test.qm"
+ "custom-dir1/fr/LC_MESSAGES/custom-dir1-install-test.qm"
+ "custom-dir2/es/LC_MESSAGES/custom-dir2-install-test.qm"
+ "custom-dir2/fr/LC_MESSAGES/custom-dir2-install-test.qm"
)
file(GLOB_RECURSE actual_files RELATIVE "${ACTUAL_TREE}" "${ACTUAL_TREE}/*")
list(SORT exp_files)
@@ -51,5 +57,5 @@ if(NOT exp_files STREQUAL actual_files)
endif()
if (fail)
- message("Test failed!")
+ message(FATAL_ERROR "Test failed!")
endif()
diff --git a/tests/ECMPoQmToolsTest/test.po b/tests/ECMPoQmToolsTest/only-process.po
index 107d1b08..107d1b08 100644
--- a/tests/ECMPoQmToolsTest/test.po
+++ b/tests/ECMPoQmToolsTest/only-process.po
diff --git a/tests/ECMPoQmToolsTest/po-custom-dir1/es/custom-dir1-install-test.po b/tests/ECMPoQmToolsTest/po-custom-dir1/es/custom-dir1-install-test.po
new file mode 100644
index 00000000..107d1b08
--- /dev/null
+++ b/tests/ECMPoQmToolsTest/po-custom-dir1/es/custom-dir1-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-custom-dir1/fr/custom-dir1-install-test.po b/tests/ECMPoQmToolsTest/po-custom-dir1/fr/custom-dir1-install-test.po
new file mode 100644
index 00000000..107d1b08
--- /dev/null
+++ b/tests/ECMPoQmToolsTest/po-custom-dir1/fr/custom-dir1-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-custom-dir2/es/custom-dir2-install-test.po b/tests/ECMPoQmToolsTest/po-custom-dir2/es/custom-dir2-install-test.po
new file mode 100644
index 00000000..107d1b08
--- /dev/null
+++ b/tests/ECMPoQmToolsTest/po-custom-dir2/es/custom-dir2-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-custom-dir2/fr/custom-dir2-install-test.po b/tests/ECMPoQmToolsTest/po-custom-dir2/fr/custom-dir2-install-test.po
new file mode 100644
index 00000000..107d1b08
--- /dev/null
+++ b/tests/ECMPoQmToolsTest/po-custom-dir2/fr/custom-dir2-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/process-and-install.po b/tests/ECMPoQmToolsTest/process-and-install.po
new file mode 100644
index 00000000..107d1b08
--- /dev/null
+++ b/tests/ECMPoQmToolsTest/process-and-install.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 ""