[Lldb-commits] [lldb] 6b37c47 - [lldb] Improve test failure messages in vscode tests

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 10 06:32:56 PDT 2020


Author: Pavel Labath
Date: 2020-03-10T14:32:45+01:00
New Revision: 6b37c476a2d4e63f6c02ca8996e0e92ae3db3282

URL: https://github.com/llvm/llvm-project/commit/6b37c476a2d4e63f6c02ca8996e0e92ae3db3282
DIFF: https://github.com/llvm/llvm-project/commit/6b37c476a2d4e63f6c02ca8996e0e92ae3db3282.diff

LOG: [lldb] Improve test failure messages in vscode tests

A couple of tests sporadically fail on these assertions, but the error
messages do not give a clue as to what has actually happened.

Improve them so that we can better understand what is going wrong.

Added: 
    

Modified: 
    lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py

Removed: 
    


################################################################################
diff  --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
index 1eb23ce56212..54f09e2cdbee 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
@@ -230,11 +230,11 @@ def continue_to_exception_breakpoint(self, filter_label):
     def continue_to_exit(self, exitCode=0):
         self.vscode.request_continue()
         stopped_events = self.vscode.wait_for_stopped()
-        self.assertTrue(len(stopped_events) == 1,
-                        "expecting single 'exited' event")
-        self.assertTrue(stopped_events[0]['event'] == 'exited',
+        self.assertEquals(len(stopped_events), 1,
+                        "stopped_events = {}".format(stopped_events))
+        self.assertEquals(stopped_events[0]['event'], 'exited',
                         'make sure program ran to completion')
-        self.assertTrue(stopped_events[0]['body']['exitCode'] == exitCode,
+        self.assertEquals(stopped_events[0]['body']['exitCode'], exitCode,
                         'exitCode == %i' % (exitCode))
 
     def attach(self, program=None, pid=None, waitFor=None, trace=None,


        


More information about the lldb-commits mailing list