Alexandre Ganea 79809f58b0 [LLDB] On Windows, fix tests
This patch fixes a few issues seen when running `ninja check-lldb` in a Release build with VS2017:

- Some binaries couldn't be found (such as lldb-vscode.exe), because .exe wasn't appended to the file name.
- Many tests used to fail since our installed locale is in French - the OS error messages are not emitted in English.
- Our codepage being Windows-1252, python failed to decode some error messages with accentuations.

Differential Revision: https://reviews.llvm.org/D88975
2020-10-08 11:46:59 -04:00

16 lines
696 B
Python

class BuildError(Exception):
def __init__(self, called_process_error):
super(BuildError, self).__init__("Error when building test subject")
self.command = called_process_error.lldb_extensions.get(
"command", "<command unavailable>")
self.build_error = called_process_error.lldb_extensions["combined_output"]
def __str__(self):
return self.format_build_error(self.command, self.build_error)
@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", errors='ignore'))