[Lldb-commits] [lldb] 99e63f5 - [lldb] Print the command output when 'expect' fails even if a custom msg is passed

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 31 01:17:07 PST 2020


Author: Raphael Isemann
Date: 2020-01-31T10:16:46+01:00
New Revision: 99e63f5825ac30912bab1daa563cae9e6c292d52

URL: https://github.com/llvm/llvm-project/commit/99e63f5825ac30912bab1daa563cae9e6c292d52
DIFF: https://github.com/llvm/llvm-project/commit/99e63f5825ac30912bab1daa563cae9e6c292d52.diff

LOG: [lldb] Print the command output when 'expect' fails even if a custom msg is passed

Currently if 'expect' fails and a custom msg is supplied, then lldbtest
will not print the actual command output. This makes it impossible to know
why the test actually failed. This just prints the command output even
if the msg parameter was supplied.

Added: 
    

Modified: 
    lldb/packages/Python/lldbsuite/test/lldbtest.py

Removed: 
    


################################################################################
diff  --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index 2b83d26d234a..602749c80fa8 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -2364,7 +2364,8 @@ def expect(
                     break
 
         self.assertTrue(matched if matching else not matched,
-                        msg if msg else EXP_MSG(str, output, exe))
+                        msg + "\nCommand output:\n" + EXP_MSG(str, output, exe)
+                        if msg else EXP_MSG(str, output, exe))
 
     def expect_expr(
             self,


        


More information about the lldb-commits mailing list