From 24fc3177c1767535aeb494511a13dabf9f6de647 Mon Sep 17 00:00:00 2001 From: Raphael Isemann Date: Mon, 17 Aug 2020 09:53:25 +0200 Subject: [PATCH] [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 --- lldb/packages/Python/lldbsuite/test/test_result.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/test_result.py b/lldb/packages/Python/lldbsuite/test/test_result.py index 54affca..cab446d 100644 --- a/lldb/packages/Python/lldbsuite/test/test_result.py +++ b/lldb/packages/Python/lldbsuite/test/test_result.py @@ -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( -- 2.7.4