aboutsummaryrefslogtreecommitdiff
path: root/tests/ECMPoQmToolsTest/check.cmake.in
diff options
context:
space:
mode:
authorAlex Merry <alex.merry@kde.org>2015-11-08 19:23:22 +0000
committerAlex Merry <alex.merry@kde.org>2015-11-08 19:29:44 +0000
commit6745bd7e4796560959bb67e33b7c7f86f96a5a94 (patch)
treed2b8b878f05873ca9588d658bdf1fb3b7ba32df0 /tests/ECMPoQmToolsTest/check.cmake.in
parentc58a8eefb05d0749bb4cc26a6cd74dee34e1f4be (diff)
downloadextra-cmake-modules-6745bd7e4796560959bb67e33b7c7f86f96a5a94.tar.gz
extra-cmake-modules-6745bd7e4796560959bb67e33b7c7f86f96a5a94.tar.bz2
Revert "Make sure we load translations on the main thread."
This broke the build for projects which used ecm_create_qm_loader in unusual ways. A better approach is coming, but won't be in e-c-m 5.16. This reverts commit 009c480413910e8c1a18f4d1420f4a517ea606e6. CCBUG: 346188 CCMAIL: release-team@kde.org CCMAIL: kde-buildsystem@kde.org
Diffstat (limited to 'tests/ECMPoQmToolsTest/check.cmake.in')
-rw-r--r--tests/ECMPoQmToolsTest/check.cmake.in81
1 files changed, 0 insertions, 81 deletions
diff --git a/tests/ECMPoQmToolsTest/check.cmake.in b/tests/ECMPoQmToolsTest/check.cmake.in
deleted file mode 100644
index 2f0cc205..00000000
--- a/tests/ECMPoQmToolsTest/check.cmake.in
+++ /dev/null
@@ -1,81 +0,0 @@
-set(BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@")
-set(ACTUAL_TREE "@CMAKE_INSTALL_PREFIX@")
-include("${BINARY_DIR}/check_conf.cmake")
-
-set(fail OFF)
-
-macro(mark_failed msg)
- message(WARNING "FAIL: ${msg}")
- set(fail ON)
-endmacro()
-
-macro(check_exists file)
- message(STATUS "Checking for ${file}")
- if (NOT EXISTS ${file})
- mark_failed("File \"${file}\" does not exist")
- endif()
-endmacro()
-
-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"
- "share/locale/en/LC_MESSAGES/catalog.qm"
- "share/locale/en_GB/LC_MESSAGES/catalog.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)
-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()
-else()
- message(STATUS "Installed translations in expected locations")
-endif()
-
-# we know we can modify the executable environment on Linux
-if("@CMAKE_SYSTEM_NAME@" STREQUAL "Linux")
- set(exp_output_en "english text:english plural form 5")
- set(exp_output_en_GB "british english text:british english plural form 5")
- # no french translation provided -> english fallback
- set(exp_output_fr "${exp_output_en}")
- foreach(exec TR_TEST TR_THREAD_TEST)
- foreach(lang en en_GB fr)
- execute_process(
- COMMAND "${CMAKE_COMMAND}" -E env "XDG_DATA_DIRS=${ACTUAL_TREE}/share"
- LC_ALL=${lang} "${${exec}_EXEC}"
- OUTPUT_VARIABLE output
- )
- string(STRIP "${output}" stripped_output)
- if(NOT stripped_output STREQUAL exp_output_${lang})
- message(WARNING "${exec}[${lang}] output was \"${stripped_output}\", but expected \"${exp_output_${lang}}\"")
- set(fail ON)
- else()
- message(STATUS "${exec}[${lang}] output was \"${stripped_output}\", as expected")
- endif()
- endforeach()
- endforeach()
-endif()
-
-if (fail)
- message(FATAL_ERROR "Test failed!")
-endif()