[Lldb-commits] [lldb] r275791 - Revert "[test] Report error when inferior test processes exit with a non-zero code"
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Mon Jul 18 07:42:02 PDT 2016
Author: labath
Date: Mon Jul 18 09:42:01 2016
New Revision: 275791
URL: http://llvm.org/viewvc/llvm-project?rev=275791&view=rev
Log:
Revert "[test] Report error when inferior test processes exit with a non-zero code"
This reverts r275782.
The problem with the commit is that it reports an additional "exit (1)" error for every file
containing a failing test, which is far more than I had intended to do. I'll need to come up with
a more fine-grained way of achieving the result.
Modified:
lldb/trunk/packages/Python/lldbsuite/test/dosep.py
lldb/trunk/packages/Python/lldbsuite/test/test_runner/process_control.py
Modified: lldb/trunk/packages/Python/lldbsuite/test/dosep.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dosep.py?rev=275791&r1=275790&r2=275791&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/dosep.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dosep.py Mon Jul 18 09:42:01 2016
@@ -109,14 +109,13 @@ def report_test_failure(name, command, o
with output_lock:
if not (RESULTS_FORMATTER and RESULTS_FORMATTER.is_using_terminal()):
print(file=sys.stderr)
+ print(output, file=sys.stderr)
if timeout:
timeout_str = " (TIMEOUT)"
else:
timeout_str = ""
print("[%s FAILED]%s" % (name, timeout_str), file=sys.stderr)
print("Command invoked: %s" % ' '.join(command), file=sys.stderr)
- print("Command stderr:\n", output[1], file=sys.stderr)
- print("Command stdout:\n", output[0], file=sys.stderr)
update_progress(name)
@@ -211,7 +210,7 @@ class DoTestProcessDriver(process_contro
# only stderr does.
report_test_pass(self.file_name, output[1])
else:
- report_test_failure(self.file_name, command, output, was_timeout)
+ report_test_failure(self.file_name, command, output[1], was_timeout)
# Save off the results for the caller.
self.results = (
Modified: lldb/trunk/packages/Python/lldbsuite/test/test_runner/process_control.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/test_runner/process_control.py?rev=275791&r1=275790&r2=275791&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/test_runner/process_control.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/test_runner/process_control.py Mon Jul 18 09:42:01 2016
@@ -246,25 +246,33 @@ class ProcessHelper(object):
def is_exceptional_exit(self, popen_status):
"""Returns whether the program exit status is exceptional.
- Returns whether the return code from a Popen process is exceptional.
+ Returns whether the return code from a Popen process is exceptional
+ (e.g. signals on POSIX systems).
+
+ Derived classes should override this if they can detect exceptional
+ program exit.
@return True if the given popen_status represents an exceptional
program exit; False otherwise.
"""
- return popen_status != 0
+ return False
def exceptional_exit_details(self, popen_status):
"""Returns the normalized exceptional exit code and a description.
Given an exceptional exit code, returns the integral value of the
- exception and a description for the result.
+ exception (e.g. signal number for POSIX) and a description (e.g.
+ signal name on POSIX) for the result.
+
+ Derived classes should override this if they can detect exceptional
+ program exit.
- Derived classes can override this if they want to want custom
- exceptional exit code handling.
+ It is fine to not implement this so long as is_exceptional_exit()
+ always returns False.
@return (normalized exception code, symbolic exception description)
"""
- return (popen_status, "exit")
+ raise Exception("exception_exit_details() called on unsupported class")
class UnixProcessHelper(ProcessHelper):
@@ -389,6 +397,9 @@ class UnixProcessHelper(ProcessHelper):
def soft_terminate_signals(self):
return [signal.SIGQUIT, signal.SIGTERM]
+ def is_exceptional_exit(self, popen_status):
+ return popen_status < 0
+
@classmethod
def _signal_names_by_number(cls):
return dict(
@@ -396,8 +407,6 @@ class UnixProcessHelper(ProcessHelper):
if v.startswith('SIG') and not v.startswith('SIG_'))
def exceptional_exit_details(self, popen_status):
- if popen_status >= 0:
- return (popen_status, "exit")
signo = -popen_status
signal_names_by_number = self._signal_names_by_number()
signal_name = signal_names_by_number.get(signo, "")
More information about the lldb-commits
mailing list