diff --git a/.github/workflows/windows-msys2.yml b/.github/workflows/windows-msys2.yml index fd085665b..076385f3d 100644 --- a/.github/workflows/windows-msys2.yml +++ b/.github/workflows/windows-msys2.yml @@ -150,6 +150,7 @@ jobs: - name: Test run: | # Change codepage to utf-8 + env cat /d/a/_temp/setup-msys2/msys2.CMD echo $PATH echo "Lang:" @@ -176,6 +177,7 @@ jobs: export PYTHONUTF8=1 export PATH="$PWD/build/src/lib:$PATH" export RNP_LOG_CONSOLE=1 + ctest --test-dir build -C Debug -V -R rnp_tests.test_windows_unicode || true ctest --parallel ${{ env.CORES }} --test-dir build -C Debug --output-on-failure -R rnp_tests.test_cli_rnpkeys_unicode - name: Install diff --git a/src/tests/cli.cpp b/src/tests/cli.cpp index c8f943306..a0645590b 100644 --- a/src/tests/cli.cpp +++ b/src/tests/cli.cpp @@ -401,7 +401,7 @@ TEST_F(rnp_tests, test_cli_rnpkeys_unicode) STARTUPINFOW siw; ZeroMemory(&siw, sizeof siw); ZeroMemory(&pi, sizeof pi); - fprintf(stdout, "Running CreateProcessW:\n"); + fprintf(stdout, "Running CreateProcessW: %s\n", (char *) cmdline_ws.c_str()); fflush(stdout); res = CreateProcessW(NULL, (LPWSTR) cmdline_ws.c_str(), // Command line @@ -482,6 +482,35 @@ TEST_F(rnp_tests, test_cli_rnpkeys_unicode) #endif } +TEST_F(rnp_tests, test_windows_unicode) +{ +#ifdef _WIN32 + UINT acp = GetACP(); + fprintf(stdout, "GetACP: %u\n", (unsigned) acp); + fflush(stdout); + std::wstring cmdline_ws = L"D:\\a\\rnp\\rnp\\build\\src\\tests/../rnpkeys/rnpkeys.exe " + L"--list-keys \"\x03C9\x0410@b.com\""; + STARTUPINFOW siw; + ZeroMemory(&siw, sizeof siw); + PROCESS_INFORMATION pi; + ZeroMemory(&pi, sizeof pi); + BOOL res = CreateProcessW(NULL, + (LPWSTR) cmdline_ws.c_str(), // Command line + NULL, // Process handle not inheritable + NULL, // Thread handle not inheritable + FALSE, // Handle inheritance + 0, // Creation flags + NULL, // Use parent's environment block + NULL, // Use parent's starting directory + &siw, // Pointer to STARTUPINFO structure + &pi); // Pointer to PROCESS_INFORMATION structure + assert_true(res); + assert_true(WaitForSingleObject(pi.hProcess, INFINITE) == WAIT_OBJECT_0); + CloseHandle(pi.hProcess); + CloseHandle(pi.hThread); +#endif +} + TEST_F(rnp_tests, test_cli_rnp) { int ret;