Browse Source

Tests: Extend RunCMake.Ninja ShowIncludes cases to cover more languages

Add cases for English, French, German, and Japanese.
Brad King 2 years ago
parent
commit
d6e7e4d4a1

+ 3 - 0
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=$<TARGET_FILE:showIncludes>)
+    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

+ 8 - 0
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()
 

+ 3 - 0
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)

+ 1 - 0
Tests/RunCMake/Ninja/ShowIncludes-437-English-stdout.txt

@@ -0,0 +1 @@
+-- showIncludes='Note: including file: '

+ 3 - 0
Tests/RunCMake/Ninja/ShowIncludes-437-English.cmake

@@ -0,0 +1,3 @@
+set(CODEPAGE 437)
+set(VSLANG 1033)
+include(${CMAKE_CURRENT_LIST_DIR}/ShowIncludes.cmake)

+ 3 - 0
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)

+ 1 - 0
Tests/RunCMake/Ninja/ShowIncludes-437-French-stdout.txt

@@ -0,0 +1 @@
+-- showIncludes='Remarque : inclusion du fichier :  '

+ 3 - 0
Tests/RunCMake/Ninja/ShowIncludes-437-French.cmake

@@ -0,0 +1,3 @@
+set(CODEPAGE 437)
+set(VSLANG 1036)
+include(${CMAKE_CURRENT_LIST_DIR}/ShowIncludes.cmake)

+ 3 - 0
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)

+ 1 - 0
Tests/RunCMake/Ninja/ShowIncludes-437-German-stdout.txt

@@ -0,0 +1 @@
+-- showIncludes='Hinweis: Einlesen der Datei: '

+ 3 - 0
Tests/RunCMake/Ninja/ShowIncludes-437-German.cmake

@@ -0,0 +1,3 @@
+set(CODEPAGE 437)
+set(VSLANG 1031)
+include(${CMAKE_CURRENT_LIST_DIR}/ShowIncludes.cmake)

+ 3 - 0
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)

+ 1 - 0
Tests/RunCMake/Ninja/ShowIncludes-65001-French-stdout.txt

@@ -0,0 +1 @@
+-- showIncludes='Remarque : inclusion du fichier :  '

+ 3 - 0
Tests/RunCMake/Ninja/ShowIncludes-65001-French.cmake

@@ -0,0 +1,3 @@
+set(CODEPAGE 65001)
+set(VSLANG 1036)
+include(${CMAKE_CURRENT_LIST_DIR}/ShowIncludes.cmake)

+ 3 - 0
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)

+ 1 - 0
Tests/RunCMake/Ninja/ShowIncludes-65001-Japanese-stdout.txt

@@ -0,0 +1 @@
+-- showIncludes='メモ: インクルード ファイル:  '

+ 3 - 0
Tests/RunCMake/Ninja/ShowIncludes-65001-Japanese.cmake

@@ -0,0 +1,3 @@
+set(CODEPAGE 65001)
+set(VSLANG 1041)
+include(${CMAKE_CURRENT_LIST_DIR}/ShowIncludes.cmake)

+ 3 - 0
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)

+ 1 - 0
Tests/RunCMake/Ninja/ShowIncludes-932-Japanese-stdout.txt

@@ -0,0 +1 @@
+-- showIncludes='メモ: インクルード ファイル:  '

+ 3 - 0
Tests/RunCMake/Ninja/ShowIncludes-932-Japanese.cmake

@@ -0,0 +1,3 @@
+set(CODEPAGE 932)
+set(VSLANG 1041)
+include(${CMAKE_CURRENT_LIST_DIR}/ShowIncludes.cmake)

+ 40 - 0
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: "