summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/CommandLine
diff options
context:
space:
mode:
authormakise-homura <akemi_homura@kurisa.ch>2021-10-12 21:56:13 +0300
committermakise-homura <akemi_homura@kurisa.ch>2021-10-15 05:04:24 +0300
commitea55ac9a519c681c3e3e2cece6f7974cbf691790 (patch)
tree82a78f04e37580c2c903123bd59c99d23157d218 /Tests/RunCMake/CommandLine
parent3068ea834ff17bd5d2e8438c1a8d3a6331d10f62 (diff)
downloadcmake-ea55ac9a519c681c3e3e2cece6f7974cbf691790.tar.gz
Tests/RunCMake/CommandLine: Deal with locales that are different from English
RunCMake/CommandLine has problems when ran using language setting differeng from English. This is due to test outputs being compared to English strings, which comparison obviously fails if this language is set to, e.g. Russian. This commit sets locale as "C" prior to running these tests, so messages while testing are generated in correct language and do not fail checks anymore.
Diffstat (limited to 'Tests/RunCMake/CommandLine')
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index dc066f1d1f..74cd90aae4 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -247,8 +247,14 @@ function(run_BuildDir)
run_cmake_command(BuildDir--build-jobs-no-number-trailing--target ${CMAKE_COMMAND} -E chdir ..
${CMAKE_COMMAND} --build BuildDir-build -j --target CustomTarget)
if(RunCMake_GENERATOR MATCHES "Unix Makefiles" OR RunCMake_GENERATOR MATCHES "Ninja")
+ set(_backup_lang "$ENV{LANG}")
+ set(_backup_lc_messages "$ENV{LC_MESSAGES}")
+ set(ENV{LANG} "C")
+ set(ENV{LC_MESSAGES} "C")
run_cmake_command(BuildDir--build-jobs-no-number-trailing--invalid-target ${CMAKE_COMMAND} -E chdir ..
${CMAKE_COMMAND} --build BuildDir-build -j --target invalid-target)
+ set(ENV{LANG} "${_backup_lang}")
+ set(ENV{LC_MESSAGES} "${_backup_lc_messages}")
endif()
run_cmake_command(BuildDir--build--parallel-no-number ${CMAKE_COMMAND} -E chdir ..
${CMAKE_COMMAND} --build BuildDir-build --parallel)