summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2010-11-09 18:42:22 +0000
committerJohnny Chen <johnny.chen@apple.com>2010-11-09 18:42:22 +0000
commitc0c67f275d9cc6f0bb34092da8a20448740c2dba (patch)
tree42fa66e046bb67d5d26136efcf864662f7cffc0c
parent99202b358f364f8fc352152a4da609022f5f78a5 (diff)
downloadbcm5719-llvm-c0c67f275d9cc6f0bb34092da8a20448740c2dba.tar.gz
bcm5719-llvm-c0c67f275d9cc6f0bb34092da8a20448740c2dba.zip
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 llvm-svn: 118599
-rw-r--r--lldb/test/lldbtest.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/lldb/test/lldbtest.py b/lldb/test/lldbtest.py
index 7f1428e3ef4..9b5979aa70c 100644
--- a/lldb/test/lldbtest.py
+++ b/lldb/test/lldbtest.py
@@ -177,11 +177,15 @@ VARIABLES_DISPLAYED_CORRECTLY = "Variable(s) displayed correctly"
#
# 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 @@ class TestBase(unittest2.TestCase):
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 @@ class TestBase(unittest2.TestCase):
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."""
OpenPOWER on IntegriCloud