[Lldb-commits] [lldb] r118599 - /lldb/trunk/test/lldbtest.py

Johnny Chen johnny.chen at apple.com
Tue Nov 9 10:42:22 PST 2010


Author: johnny
Date: Tue Nov  9 12:42:22 2010
New Revision: 118599

URL: http://llvm.org/viewvc/llvm-project?rev=118599&view=rev
Log:
Distinguish between the assert messages for runCmd and expect.  The former now
takes the form:

    "Command '%s' returns successfully" % str

and the latter takes the form:

    "'%s' returns expected result" % str
    or
    "'%s' matches expected result" % str

Modified:
    lldb/trunk/test/lldbtest.py

Modified: lldb/trunk/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=118599&r1=118598&r2=118599&view=diff
==============================================================================
--- lldb/trunk/test/lldbtest.py (original)
+++ lldb/trunk/test/lldbtest.py Tue Nov  9 12:42:22 2010
@@ -177,11 +177,15 @@
 #
 # And a generic "Command '%s' returns successfully" message generator.
 #
-def CMD_MSG(str, exe):
-    if exe:
-        return "Command '%s' returns successfully" % str
-    else:
-        return "'%s' compares successfully" % str
+def CMD_MSG(str):
+    return "Command '%s' returns successfully" % str
+
+#
+# And a generic "'%s' returns expected result" message generator if exe.
+# Otherwise, it's "'%s' matches expected result"
+#
+def EXP_MSG(str, exe):
+    return "'%s' %s expected result" % (str, 'returns' if exe else 'matches')
 
 #
 # And a generic "Value of setting '%s' is correct" message generator.
@@ -657,7 +661,7 @@
 
         if check:
             self.assertTrue(self.res.Succeeded(),
-                            msg if msg else CMD_MSG(cmd, True))
+                            msg if msg else CMD_MSG(cmd))
 
     def expect(self, str, msg=None, patterns=None, startstr=None, substrs=None, trace=False, error=False, matching=True, exe=True):
         """
@@ -741,7 +745,7 @@
                     break
 
         self.assertTrue(matched if matching else not matched,
-                        msg if msg else CMD_MSG(str, exe))
+                        msg if msg else EXP_MSG(str, exe))
 
     def invoke(self, obj, name, trace=False):
         """Use reflection to call a method dynamically with no argument."""





More information about the lldb-commits mailing list