diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py --- a/lldb/packages/Python/lldbsuite/test/dotest.py +++ b/lldb/packages/Python/lldbsuite/test/dotest.py @@ -52,6 +52,9 @@ """Returns true if fpath is an executable.""" if fpath == None: return False + if sys.platform == 'win32': + if not fpath.endswith(".exe"): + fpath += ".exe" return os.path.isfile(fpath) and os.access(fpath, os.X_OK) diff --git a/lldb/packages/Python/lldbsuite/test_event/build_exception.py b/lldb/packages/Python/lldbsuite/test_event/build_exception.py --- a/lldb/packages/Python/lldbsuite/test_event/build_exception.py +++ b/lldb/packages/Python/lldbsuite/test_event/build_exception.py @@ -12,4 +12,4 @@ @staticmethod def format_build_error(command, command_output): return "Error when building test subject.\n\nBuild Command:\n{}\n\nBuild Command Output:\n{}".format( - command, command_output.decode("utf-8")) + command, command_output.decode("utf-8", errors='ignore')) diff --git a/lldb/test/API/commands/target/basic/TestTargetCommand.py b/lldb/test/API/commands/target/basic/TestTargetCommand.py --- a/lldb/test/API/commands/target/basic/TestTargetCommand.py +++ b/lldb/test/API/commands/target/basic/TestTargetCommand.py @@ -353,7 +353,7 @@ @no_debug_info_test def test_target_create_nonexistent_core_file(self): self.expect("target create -c doesntexist", error=True, - patterns=["Cannot open 'doesntexist'", ": (No such file or directory|The system cannot find the file specified)"]) + patterns=["Cannot open 'doesntexist'", ": (No such file or directory|The system cannot find the file specified|Le fichier sp\udce9cifi\udce9 est introuvable)"]) # Write only files don't seem to be supported on Windows. @skipIfWindows @@ -368,7 +368,7 @@ @no_debug_info_test def test_target_create_nonexistent_sym_file(self): self.expect("target create -s doesntexist doesntexisteither", error=True, - patterns=["Cannot open '", ": (No such file or directory|The system cannot find the file specified)"]) + patterns=["Cannot open '", ": (No such file or directory|The system cannot find the file specified|Le fichier sp\udce9cifi\udce9 est introuvable)"]) @skipIfWindows @no_debug_info_test diff --git a/lldb/unittests/Utility/StatusTest.cpp b/lldb/unittests/Utility/StatusTest.cpp --- a/lldb/unittests/Utility/StatusTest.cpp +++ b/lldb/unittests/Utility/StatusTest.cpp @@ -10,7 +10,7 @@ #include "gtest/gtest.h" #ifdef _WIN32 -#include +#include #endif using namespace lldb_private; @@ -71,6 +71,14 @@ EXPECT_FALSE(success.ToError()); EXPECT_TRUE(success.Success()); + WCHAR name[128]{}; + GetLocaleInfoEx(LOCALE_NAME_USER_DEFAULT, LOCALE_SNAME, (LPWSTR)&name, + sizeof(name) / sizeof(WCHAR)); + // Skip the following tests on non-English, non-US, locales because the + // formatted messages will be different. + if (wcscmp(L"en-US", name) != 0) + return; + auto s = Status(ERROR_ACCESS_DENIED, ErrorType::eErrorTypeWin32); EXPECT_TRUE(s.Fail()); EXPECT_STREQ("Access is denied. ", s.AsCString());