[lldb] Print the exception traceback when hitting cleanup errors

Right now if the test suite encounters a cleanup error it just prints "CLEANUP
ERROR:" but not any additional information.

This patch just prints the exception that caused the cleanup error. This should
make debugging the failing tests for D83865 easier (and seems in general nice to
have).

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D83874
This commit is contained in:
Raphael Isemann 2020-08-17 09:53:25 +02:00
parent a206f85091
commit 24fc3177c1
1 changed files with 3 additions and 2 deletions

View File

@ -9,6 +9,7 @@ and results of a single test run.
# System modules
import os
import traceback
# Third-party modules
import unittest2
@ -228,8 +229,8 @@ class LLDBTestResult(unittest2.TextTestResult):
if method:
method()
self.stream.write(
"CLEANUP ERROR: LLDB (%s) :: %s\n" %
(self._config_string(test), str(test)))
"CLEANUP ERROR: LLDB (%s) :: %s\n%s\n" %
(self._config_string(test), str(test), traceback.format_exc()))
def addFailure(self, test, err):
if (self.checkExclusion(