This revision was automatically updated to reflect the committed changes. Closed by commit rGc9d5a3058fcd: [lldb] add printing of stdout compile errors to lldbsuite (authored by bbli, committed by labath).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83425/new/ https://reviews.llvm.org/D83425 Files: lldb/packages/Python/lldbsuite/test/lldbtest.py lldb/packages/Python/lldbsuite/test_event/build_exception.py lldb/test/API/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py Index: lldb/test/API/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py =================================================================== --- lldb/test/API/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py +++ lldb/test/API/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py @@ -146,7 +146,7 @@ if self.getCompiler().endswith('gcc') and not self.getCompiler().endswith('llvm-gcc'): import re gcc_version_output = system( - [[lldbutil.which(self.getCompiler()), "-v"]])[1] + [[lldbutil.which(self.getCompiler()), "-v"]]) self.trace("my output:", gcc_version_output) for line in gcc_version_output.split(os.linesep): m = re.search('\(Apple Inc\. build ([0-9]+)\)', line) Index: lldb/packages/Python/lldbsuite/test_event/build_exception.py =================================================================== --- lldb/packages/Python/lldbsuite/test_event/build_exception.py +++ lldb/packages/Python/lldbsuite/test_event/build_exception.py @@ -4,8 +4,7 @@ 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.get( - "stderr_content", "<error output unavailable>") + self.build_error = called_process_error.lldb_extensions["combined_output"] def __str__(self): return self.format_build_error(self.command, self.build_error) Index: lldb/packages/Python/lldbsuite/test/lldbtest.py =================================================================== --- lldb/packages/Python/lldbsuite/test/lldbtest.py +++ lldb/packages/Python/lldbsuite/test/lldbtest.py @@ -426,7 +426,7 @@ process = Popen( shellCommand, stdout=PIPE, - stderr=PIPE, + stderr=STDOUT, shell=True, **kwargs) pid = process.pid @@ -440,14 +440,12 @@ cpe = CalledProcessError(retcode, cmd) # Ensure caller can access the stdout/stderr. cpe.lldb_extensions = { - "stdout_content": this_output, - "stderr_content": this_error, + "combined_output": this_output, "command": shellCommand } raise cpe output = output + this_output.decode("utf-8") - error = error + this_error.decode("utf-8") - return (output, error) + return output def getsource_if_available(obj): @@ -1280,7 +1278,7 @@ version = 'unknown' compiler = self.getCompilerBinary() - version_output = system([[compiler, "-v"]])[1] + version_output = system([[compiler, "-v"]]) for line in version_output.split(os.linesep): m = re.search('version ([0-9\.]+)', line) if m:
Index: lldb/test/API/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py =================================================================== --- lldb/test/API/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py +++ lldb/test/API/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py @@ -146,7 +146,7 @@ if self.getCompiler().endswith('gcc') and not self.getCompiler().endswith('llvm-gcc'): import re gcc_version_output = system( - [[lldbutil.which(self.getCompiler()), "-v"]])[1] + [[lldbutil.which(self.getCompiler()), "-v"]]) self.trace("my output:", gcc_version_output) for line in gcc_version_output.split(os.linesep): m = re.search('\(Apple Inc\. build ([0-9]+)\)', line) Index: lldb/packages/Python/lldbsuite/test_event/build_exception.py =================================================================== --- lldb/packages/Python/lldbsuite/test_event/build_exception.py +++ lldb/packages/Python/lldbsuite/test_event/build_exception.py @@ -4,8 +4,7 @@ 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.get( - "stderr_content", "<error output unavailable>") + self.build_error = called_process_error.lldb_extensions["combined_output"] def __str__(self): return self.format_build_error(self.command, self.build_error) Index: lldb/packages/Python/lldbsuite/test/lldbtest.py =================================================================== --- lldb/packages/Python/lldbsuite/test/lldbtest.py +++ lldb/packages/Python/lldbsuite/test/lldbtest.py @@ -426,7 +426,7 @@ process = Popen( shellCommand, stdout=PIPE, - stderr=PIPE, + stderr=STDOUT, shell=True, **kwargs) pid = process.pid @@ -440,14 +440,12 @@ cpe = CalledProcessError(retcode, cmd) # Ensure caller can access the stdout/stderr. cpe.lldb_extensions = { - "stdout_content": this_output, - "stderr_content": this_error, + "combined_output": this_output, "command": shellCommand } raise cpe output = output + this_output.decode("utf-8") - error = error + this_error.decode("utf-8") - return (output, error) + return output def getsource_if_available(obj): @@ -1280,7 +1278,7 @@ version = 'unknown' compiler = self.getCompilerBinary() - version_output = system([[compiler, "-v"]])[1] + version_output = system([[compiler, "-v"]]) for line in version_output.split(os.linesep): m = re.search('version ([0-9\.]+)', line) if m:
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits