Reviewers: Jakob,

Message:
PTAL

Description:
Make webkit test output comparison compatible to stress testing.

In stress testing, the output is repeated several times. In this case, it is now
compared several times to the actual output.

Please review this at https://codereview.chromium.org/18062002/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M test/webkit/testcfg.py


Index: test/webkit/testcfg.py
diff --git a/test/webkit/testcfg.py b/test/webkit/testcfg.py
index 2c4a29c03e61a836878073ca4e63890a19197bb6..f3b3f5b458563161b084ddeddb467ac5027af340 100644
--- a/test/webkit/testcfg.py
+++ b/test/webkit/testcfg.py
@@ -28,7 +28,6 @@
 import itertools
 import os
 import re
-
 from testrunner.local import testsuite
 from testrunner.objects import testcase

@@ -116,16 +115,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 seperator 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


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to