Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Unified Diff: test/webkit/testcfg.py

Issue 18062002: Make webkit test output comparison compatible to stress testing. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Reworked review comments. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/webkit/testcfg.py
diff --git a/test/webkit/testcfg.py b/test/webkit/testcfg.py
index 2c4a29c03e61a836878073ca4e63890a19197bb6..e4e3f8fa8b94691ad847b47aef77b03c2de7197c 100644
--- a/test/webkit/testcfg.py
+++ b/test/webkit/testcfg.py
@@ -116,16 +116,40 @@ class WebkitTestSuite(testsuite.TestSuite):
return True
file_name = os.path.join(self.root, testpath) + "-expected.txt"
with file(file_name, "r") as expected:
- def ExpIterator():
- for line in expected.readlines():
- if line.startswith("#") or not line.strip(): continue
- yield line.strip()
- def ActIterator():
- for line in output.stdout.splitlines():
- if self._IgnoreLine(line.strip()): continue
- yield line.strip()
+ expected_lines = expected.readlines()
+
+ def ExpIterator():
+ for line in expected_lines:
+ if line.startswith("#") or not line.strip(): continue
+ yield line.strip()
+
+ def ActIterator(lines):
+ for line in lines:
+ if self._IgnoreLine(line.strip()): continue
+ yield line.strip()
+
+ def ActBlockIterator():
+ """Iterates over blocks of actual output lines."""
+ lines = output.stdout.splitlines()
+ start_index = 0
+ found_eqeq = False
+ for index, line in enumerate(lines):
+ # If a stress test separator is found:
+ if line.startswith("=="):
+ # Iterate over all lines before a separator except the first.
+ if not found_eqeq:
+ found_eqeq = True
+ else:
+ yield ActIterator(lines[start_index:index])
+ # The next block of ouput lines starts after the separator.
+ start_index = index + 1
+ # Iterate over complete output if no separator was found.
+ if not found_eqeq:
+ yield ActIterator(lines)
+
+ for act_iterator in ActBlockIterator():
for (expected, actual) in itertools.izip_longest(
- ExpIterator(), ActIterator(), fillvalue=''):
+ ExpIterator(), act_iterator, fillvalue=''):
if expected != actual:
return True
return False
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698