From d6e7e4d4a1844af15c005dab2db6237464ad160d Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 26 Jan 2023 15:11:40 -0500 Subject: Tests: Extend RunCMake.Ninja ShowIncludes cases to cover more languages Add cases for English, French, German, and Japanese. --- Tests/RunCMake/CMakeLists.txt | 3 ++ Tests/RunCMake/Ninja/RunCMakeTest.cmake | 8 +++++ .../Ninja/ShowIncludes-437-English-check.cmake | 3 ++ .../Ninja/ShowIncludes-437-English-stdout.txt | 1 + .../RunCMake/Ninja/ShowIncludes-437-English.cmake | 3 ++ .../Ninja/ShowIncludes-437-French-check.cmake | 3 ++ .../Ninja/ShowIncludes-437-French-stdout.txt | 1 + Tests/RunCMake/Ninja/ShowIncludes-437-French.cmake | 3 ++ .../Ninja/ShowIncludes-437-German-check.cmake | 3 ++ .../Ninja/ShowIncludes-437-German-stdout.txt | 1 + Tests/RunCMake/Ninja/ShowIncludes-437-German.cmake | 3 ++ .../Ninja/ShowIncludes-65001-French-check.cmake | 3 ++ .../Ninja/ShowIncludes-65001-French-stdout.txt | 1 + .../RunCMake/Ninja/ShowIncludes-65001-French.cmake | 3 ++ .../Ninja/ShowIncludes-65001-Japanese-check.cmake | 3 ++ .../Ninja/ShowIncludes-65001-Japanese-stdout.txt | 1 + .../Ninja/ShowIncludes-65001-Japanese.cmake | 3 ++ .../Ninja/ShowIncludes-932-Japanese-check.cmake | 3 ++ .../Ninja/ShowIncludes-932-Japanese-stdout.txt | 1 + .../RunCMake/Ninja/ShowIncludes-932-Japanese.cmake | 3 ++ Tests/RunCMake/showIncludes.c | 40 ++++++++++++++++++++++ 21 files changed, 93 insertions(+) create mode 100644 Tests/RunCMake/Ninja/ShowIncludes-437-English-check.cmake create mode 100644 Tests/RunCMake/Ninja/ShowIncludes-437-English-stdout.txt create mode 100644 Tests/RunCMake/Ninja/ShowIncludes-437-English.cmake create mode 100644 Tests/RunCMake/Ninja/ShowIncludes-437-French-check.cmake create mode 100644 Tests/RunCMake/Ninja/ShowIncludes-437-French-stdout.txt create mode 100644 Tests/RunCMake/Ninja/ShowIncludes-437-French.cmake create mode 100644 Tests/RunCMake/Ninja/ShowIncludes-437-German-check.cmake create mode 100644 Tests/RunCMake/Ninja/ShowIncludes-437-German-stdout.txt create mode 100644 Tests/RunCMake/Ninja/ShowIncludes-437-German.cmake create mode 100644 Tests/RunCMake/Ninja/ShowIncludes-65001-French-check.cmake create mode 100644 Tests/RunCMake/Ninja/ShowIncludes-65001-French-stdout.txt create mode 100644 Tests/RunCMake/Ninja/ShowIncludes-65001-French.cmake create mode 100644 Tests/RunCMake/Ninja/ShowIncludes-65001-Japanese-check.cmake create mode 100644 Tests/RunCMake/Ninja/ShowIncludes-65001-Japanese-stdout.txt create mode 100644 Tests/RunCMake/Ninja/ShowIncludes-65001-Japanese.cmake create mode 100644 Tests/RunCMake/Ninja/ShowIncludes-932-Japanese-check.cmake create mode 100644 Tests/RunCMake/Ninja/ShowIncludes-932-Japanese-stdout.txt create mode 100644 Tests/RunCMake/Ninja/ShowIncludes-932-Japanese.cmake diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index be6c5b1..a7a8295 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -200,6 +200,9 @@ if(CMAKE_GENERATOR MATCHES "Ninja") if(WIN32) add_executable(showIncludes showIncludes.c) list(APPEND Ninja_ARGS -DshowIncludes=$) + if(CMake_TEST_NO_CODEPAGE_9xx) + list(APPEND Ninja_ARGS -DCMake_TEST_NO_CODEPAGE_9xx=1) + endif() endif() add_RunCMake_test(Ninja) set(NinjaMultiConfig_ARGS diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake index 73a9d15..d63c0c4 100644 --- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake +++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake @@ -46,8 +46,16 @@ if(WIN32) if(RunCMake_MAKE_PROGRAM) set(maybe_MAKE_PROGRAM "-DRunCMake_MAKE_PROGRAM=${RunCMake_MAKE_PROGRAM}") endif() + run_cmake_script(ShowIncludes-437-English -DshowIncludes=${showIncludes} ${maybe_MAKE_PROGRAM}) + run_cmake_script(ShowIncludes-437-French -DshowIncludes=${showIncludes} ${maybe_MAKE_PROGRAM}) + run_cmake_script(ShowIncludes-437-German -DshowIncludes=${showIncludes} ${maybe_MAKE_PROGRAM}) run_cmake_script(ShowIncludes-54936-Chinese -DshowIncludes=${showIncludes} ${maybe_MAKE_PROGRAM}) run_cmake_script(ShowIncludes-65001-Chinese -DshowIncludes=${showIncludes} ${maybe_MAKE_PROGRAM}) + run_cmake_script(ShowIncludes-65001-French -DshowIncludes=${showIncludes} ${maybe_MAKE_PROGRAM}) + run_cmake_script(ShowIncludes-65001-Japanese -DshowIncludes=${showIncludes} ${maybe_MAKE_PROGRAM}) + if(NOT CMake_TEST_NO_CODEPAGE_9xx) + run_cmake_script(ShowIncludes-932-Japanese -DshowIncludes=${showIncludes} ${maybe_MAKE_PROGRAM}) + endif() unset(maybe_MAKE_PROGRAM) endif() diff --git a/Tests/RunCMake/Ninja/ShowIncludes-437-English-check.cmake b/Tests/RunCMake/Ninja/ShowIncludes-437-English-check.cmake new file mode 100644 index 0000000..9338709 --- /dev/null +++ b/Tests/RunCMake/Ninja/ShowIncludes-437-English-check.cmake @@ -0,0 +1,3 @@ +# 'cl /showIncludes' prefix with 'VSLANG=1033' and 'chcp 437'. +set(expect "Note: including file: ") +include(${CMAKE_CURRENT_LIST_DIR}/ShowIncludes-check.cmake) diff --git a/Tests/RunCMake/Ninja/ShowIncludes-437-English-stdout.txt b/Tests/RunCMake/Ninja/ShowIncludes-437-English-stdout.txt new file mode 100644 index 0000000..bda7eab --- /dev/null +++ b/Tests/RunCMake/Ninja/ShowIncludes-437-English-stdout.txt @@ -0,0 +1 @@ +-- showIncludes='Note: including file: ' diff --git a/Tests/RunCMake/Ninja/ShowIncludes-437-English.cmake b/Tests/RunCMake/Ninja/ShowIncludes-437-English.cmake new file mode 100644 index 0000000..194b637 --- /dev/null +++ b/Tests/RunCMake/Ninja/ShowIncludes-437-English.cmake @@ -0,0 +1,3 @@ +set(CODEPAGE 437) +set(VSLANG 1033) +include(${CMAKE_CURRENT_LIST_DIR}/ShowIncludes.cmake) diff --git a/Tests/RunCMake/Ninja/ShowIncludes-437-French-check.cmake b/Tests/RunCMake/Ninja/ShowIncludes-437-French-check.cmake new file mode 100644 index 0000000..64b0498 --- /dev/null +++ b/Tests/RunCMake/Ninja/ShowIncludes-437-French-check.cmake @@ -0,0 +1,3 @@ +# 'cl /showIncludes' prefix with 'VSLANG=1036' and 'chcp 437'. +string(ASCII 82 101 109 97 114 113 117 101 255 58 32 105 110 99 108 117 115 105 111 110 32 100 117 32 102 105 99 104 105 101 114 255 58 32 32 expect) +include(${CMAKE_CURRENT_LIST_DIR}/ShowIncludes-check.cmake) diff --git a/Tests/RunCMake/Ninja/ShowIncludes-437-French-stdout.txt b/Tests/RunCMake/Ninja/ShowIncludes-437-French-stdout.txt new file mode 100644 index 0000000..1a830f1 --- /dev/null +++ b/Tests/RunCMake/Ninja/ShowIncludes-437-French-stdout.txt @@ -0,0 +1 @@ +-- showIncludes='Remarque : inclusion du fichier : ' diff --git a/Tests/RunCMake/Ninja/ShowIncludes-437-French.cmake b/Tests/RunCMake/Ninja/ShowIncludes-437-French.cmake new file mode 100644 index 0000000..9fe4055 --- /dev/null +++ b/Tests/RunCMake/Ninja/ShowIncludes-437-French.cmake @@ -0,0 +1,3 @@ +set(CODEPAGE 437) +set(VSLANG 1036) +include(${CMAKE_CURRENT_LIST_DIR}/ShowIncludes.cmake) diff --git a/Tests/RunCMake/Ninja/ShowIncludes-437-German-check.cmake b/Tests/RunCMake/Ninja/ShowIncludes-437-German-check.cmake new file mode 100644 index 0000000..c1418e3 --- /dev/null +++ b/Tests/RunCMake/Ninja/ShowIncludes-437-German-check.cmake @@ -0,0 +1,3 @@ +# 'cl /showIncludes' prefix with 'VSLANG=1031' and 'chcp 437'. +set(expect "Hinweis: Einlesen der Datei: ") +include(${CMAKE_CURRENT_LIST_DIR}/ShowIncludes-check.cmake) diff --git a/Tests/RunCMake/Ninja/ShowIncludes-437-German-stdout.txt b/Tests/RunCMake/Ninja/ShowIncludes-437-German-stdout.txt new file mode 100644 index 0000000..9b9875e --- /dev/null +++ b/Tests/RunCMake/Ninja/ShowIncludes-437-German-stdout.txt @@ -0,0 +1 @@ +-- showIncludes='Hinweis: Einlesen der Datei: ' diff --git a/Tests/RunCMake/Ninja/ShowIncludes-437-German.cmake b/Tests/RunCMake/Ninja/ShowIncludes-437-German.cmake new file mode 100644 index 0000000..882a23c --- /dev/null +++ b/Tests/RunCMake/Ninja/ShowIncludes-437-German.cmake @@ -0,0 +1,3 @@ +set(CODEPAGE 437) +set(VSLANG 1031) +include(${CMAKE_CURRENT_LIST_DIR}/ShowIncludes.cmake) diff --git a/Tests/RunCMake/Ninja/ShowIncludes-65001-French-check.cmake b/Tests/RunCMake/Ninja/ShowIncludes-65001-French-check.cmake new file mode 100644 index 0000000..133cbe6 --- /dev/null +++ b/Tests/RunCMake/Ninja/ShowIncludes-65001-French-check.cmake @@ -0,0 +1,3 @@ +# 'cl /showIncludes' prefix with 'VSLANG=1036' and 'chcp 65001'. +string(ASCII 82 101 109 97 114 113 117 101 194 160 58 32 105 110 99 108 117 115 105 111 110 32 100 117 32 102 105 99 104 105 101 114 194 160 58 32 32 expect) +include(${CMAKE_CURRENT_LIST_DIR}/ShowIncludes-check.cmake) diff --git a/Tests/RunCMake/Ninja/ShowIncludes-65001-French-stdout.txt b/Tests/RunCMake/Ninja/ShowIncludes-65001-French-stdout.txt new file mode 100644 index 0000000..1a830f1 --- /dev/null +++ b/Tests/RunCMake/Ninja/ShowIncludes-65001-French-stdout.txt @@ -0,0 +1 @@ +-- showIncludes='Remarque : inclusion du fichier : ' diff --git a/Tests/RunCMake/Ninja/ShowIncludes-65001-French.cmake b/Tests/RunCMake/Ninja/ShowIncludes-65001-French.cmake new file mode 100644 index 0000000..49927f6 --- /dev/null +++ b/Tests/RunCMake/Ninja/ShowIncludes-65001-French.cmake @@ -0,0 +1,3 @@ +set(CODEPAGE 65001) +set(VSLANG 1036) +include(${CMAKE_CURRENT_LIST_DIR}/ShowIncludes.cmake) diff --git a/Tests/RunCMake/Ninja/ShowIncludes-65001-Japanese-check.cmake b/Tests/RunCMake/Ninja/ShowIncludes-65001-Japanese-check.cmake new file mode 100644 index 0000000..852bae7 --- /dev/null +++ b/Tests/RunCMake/Ninja/ShowIncludes-65001-Japanese-check.cmake @@ -0,0 +1,3 @@ +# 'cl /showIncludes' prefix with 'VSLANG=1041' and 'chcp 65001'. +string(ASCII 227 131 161 227 131 162 58 32 227 130 164 227 131 179 227 130 175 227 131 171 227 131 188 227 131 137 32 227 131 149 227 130 161 227 130 164 227 131 171 58 32 32 expect) +include(${CMAKE_CURRENT_LIST_DIR}/ShowIncludes-check.cmake) diff --git a/Tests/RunCMake/Ninja/ShowIncludes-65001-Japanese-stdout.txt b/Tests/RunCMake/Ninja/ShowIncludes-65001-Japanese-stdout.txt new file mode 100644 index 0000000..4640616 --- /dev/null +++ b/Tests/RunCMake/Ninja/ShowIncludes-65001-Japanese-stdout.txt @@ -0,0 +1 @@ +-- showIncludes='メモ: インクルード ファイル: ' diff --git a/Tests/RunCMake/Ninja/ShowIncludes-65001-Japanese.cmake b/Tests/RunCMake/Ninja/ShowIncludes-65001-Japanese.cmake new file mode 100644 index 0000000..59cc84e --- /dev/null +++ b/Tests/RunCMake/Ninja/ShowIncludes-65001-Japanese.cmake @@ -0,0 +1,3 @@ +set(CODEPAGE 65001) +set(VSLANG 1041) +include(${CMAKE_CURRENT_LIST_DIR}/ShowIncludes.cmake) diff --git a/Tests/RunCMake/Ninja/ShowIncludes-932-Japanese-check.cmake b/Tests/RunCMake/Ninja/ShowIncludes-932-Japanese-check.cmake new file mode 100644 index 0000000..10fa194 --- /dev/null +++ b/Tests/RunCMake/Ninja/ShowIncludes-932-Japanese-check.cmake @@ -0,0 +1,3 @@ +# 'cl /showIncludes' prefix with 'VSLANG=1041' and 'chcp 932'. +string(ASCII 131 129 131 130 58 32 131 67 131 147 131 78 131 139 129 91 131 104 32 131 116 131 64 131 67 131 139 58 32 32 expect) +include(${CMAKE_CURRENT_LIST_DIR}/ShowIncludes-check.cmake) diff --git a/Tests/RunCMake/Ninja/ShowIncludes-932-Japanese-stdout.txt b/Tests/RunCMake/Ninja/ShowIncludes-932-Japanese-stdout.txt new file mode 100644 index 0000000..4640616 --- /dev/null +++ b/Tests/RunCMake/Ninja/ShowIncludes-932-Japanese-stdout.txt @@ -0,0 +1 @@ +-- showIncludes='メモ: インクルード ファイル: ' diff --git a/Tests/RunCMake/Ninja/ShowIncludes-932-Japanese.cmake b/Tests/RunCMake/Ninja/ShowIncludes-932-Japanese.cmake new file mode 100644 index 0000000..ed8203c --- /dev/null +++ b/Tests/RunCMake/Ninja/ShowIncludes-932-Japanese.cmake @@ -0,0 +1,3 @@ +set(CODEPAGE 932) +set(VSLANG 1041) +include(${CMAKE_CURRENT_LIST_DIR}/ShowIncludes.cmake) diff --git a/Tests/RunCMake/showIncludes.c b/Tests/RunCMake/showIncludes.c index 922254d..27ce458 100644 --- a/Tests/RunCMake/showIncludes.c +++ b/Tests/RunCMake/showIncludes.c @@ -28,6 +28,46 @@ int main() printf("OEM code page: %u\n", GetOEMCP()); printf("VSLANG: %s\n", vslang); + if (strcmp(vslang, "1031") == 0) { + if (cp == 437 || cp == 65001) { + printf("Hinweis: Einlesen der Datei: C:\\foo.h\n"); + return 0; + } + } + + if (strcmp(vslang, "1033") == 0) { + if (cp == 437 || cp == 65001) { + printf("Note: including file: C:\\foo.h\n"); + return 0; + } + } + + if (strcmp(vslang, "1036") == 0) { + if (cp == 437 || cp == 863) { + printf("Remarque\xff: inclusion du fichier\xff: C:\\foo.h\n"); + return 0; + } + if (cp == 65001) { + printf("Remarque\xc2\xa0: inclusion du fichier\xc2\xa0: C:\\foo.h\n"); + return 0; + } + } + + if (strcmp(vslang, "1041") == 0) { + if (cp == 932) { + printf("\x83\x81\x83\x82: " + "\x83\x43\x83\x93\x83\x4e\x83\x8b\x81\x5b\x83\x68 " + "\x83\x74\x83\x40\x83\x43\x83\x8b: C:\\foo.h\n"); + return 0; + } + if (cp == 65001) { + printf("\xe3\x83\xa1\xe3\x83\xa2: \xe3\x82\xa4\xe3\x83\xb3" + "\xe3\x82\xaf\xe3\x83\xab\xe3\x83\xbc\xe3\x83\x89 " + "\xe3\x83\x95\xe3\x82\xa1\xe3\x82\xa4\xe3\x83\xab: C:\\foo.h\n"); + return 0; + } + } + if (strcmp(vslang, "2052") == 0) { if (cp == 54936 || cp == 936) { printf("\xd7\xa2\xd2\xe2: " -- cgit v0.12