diff options
author | isaacs <i@izs.me> | 2012-08-05 11:26:18 -0700 |
---|---|---|
committer | isaacs <i@izs.me> | 2012-08-05 13:53:31 -0700 |
commit | 99ad0561c04a8b255f6049f494fe15cb56e0b382 (patch) | |
tree | 701d5eedd7124c6ffc0ee6bb8c4ee72b11b6d1cb /test/message/testcfg.py | |
parent | ddb02b978d2b577727370b36eeb828b1a522064a (diff) | |
download | android-node-v8-99ad0561c04a8b255f6049f494fe15cb56e0b382.tar.gz android-node-v8-99ad0561c04a8b255f6049f494fe15cb56e0b382.tar.bz2 android-node-v8-99ad0561c04a8b255f6049f494fe15cb56e0b382.zip |
test-message: fix message output
1. The net changes add a stack frame to stdin errors.
2. The error line numbers were overly strict in many places.
Diffstat (limited to 'test/message/testcfg.py')
-rw-r--r-- | test/message/testcfg.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/message/testcfg.py b/test/message/testcfg.py index 7d1b72e62d..105fac667d 100644 --- a/test/message/testcfg.py +++ b/test/message/testcfg.py @@ -43,7 +43,7 @@ class MessageTestCase(test.TestCase): def IgnoreLine(self, str): """Ignore empty lines and valgrind output.""" - if not str: return True + if not str.strip(): return True else: return str.startswith('==') or str.startswith('**') def IsFailureOutput(self, output): @@ -66,9 +66,22 @@ class MessageTestCase(test.TestCase): raw_lines = (output.stdout + output.stderr).split('\n') outlines = [ s for s in raw_lines if not self.IgnoreLine(s) ] if len(outlines) != len(patterns): + print "length differs." + print "expect=%d" % len(patterns) + print "actual=%d" % len(outlines) + print "patterns:" + for i in xrange(len(patterns)): + print "pattern = %s" % patterns[i] + print "outlines:" + for i in xrange(len(outlines)): + print "outline = %s" % outlines[i] return True for i in xrange(len(patterns)): if not re.match(patterns[i], outlines[i]): + print "match failed" + print "line=%d" % i + print "expect=%s" % patterns[i] + print "actual=%s" % outlines[i] return True return False |