Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2013 the V8 project authors. All rights reserved. | 1 # Copyright 2013 the V8 project authors. All rights reserved. |
| 2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
| 3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
| 4 # met: | 4 # met: |
| 5 # | 5 # |
| 6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
| 7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
| 8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
| 9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
| 10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 110 string.startswith("DEBUG MODE ENABLED") or | 110 string.startswith("DEBUG MODE ENABLED") or |
| 111 string.startswith("tools/nacl-run.py") or | 111 string.startswith("tools/nacl-run.py") or |
| 112 string.find("BYPASSING ALL ACL CHECKS") > 0 or | 112 string.find("BYPASSING ALL ACL CHECKS") > 0 or |
| 113 string.find("Native Client module will be loaded") > 0 or | 113 string.find("Native Client module will be loaded") > 0 or |
| 114 string.find("NaClHostDescOpen:") > 0 or | 114 string.find("NaClHostDescOpen:") > 0 or |
| 115 # FIXME(machenbach): The test driver shouldn't try to use slow | 115 # FIXME(machenbach): The test driver shouldn't try to use slow |
| 116 # asserts if they weren't compiled. This fails in optdebug=2. | 116 # asserts if they weren't compiled. This fails in optdebug=2. |
| 117 string == "Warning: unknown flag --enable-slow-asserts." or | 117 string == "Warning: unknown flag --enable-slow-asserts." or |
| 118 string == "Try --help for options") | 118 string == "Try --help for options") |
| 119 | 119 |
| 120 def IsFailureOutput(self, output, testpath): | 120 def IsFailureOutput(self, testcase): |
| 121 if super(WebkitTestSuite, self).IsFailureOutput(output, testpath): | 121 if super(WebkitTestSuite, self).IsFailureOutput(testcase): |
| 122 return True | 122 return True |
| 123 file_name = os.path.join(self.root, testpath) + "-expected.txt" | 123 file_name = os.path.join(self.root, testcase.testpath) + "-expected.txt" |
|
Michael Achenbach
2016/03/10 12:16:31
testcase.path
Dan Ehrenberg
2016/03/10 20:08:19
Fixed
| |
| 124 with file(file_name, "r") as expected: | 124 with file(file_name, "r") as expected: |
| 125 expected_lines = expected.readlines() | 125 expected_lines = expected.readlines() |
| 126 | 126 |
| 127 def ExpIterator(): | 127 def ExpIterator(): |
| 128 for line in expected_lines: | 128 for line in expected_lines: |
| 129 if line.startswith("#") or not line.strip(): continue | 129 if line.startswith("#") or not line.strip(): continue |
| 130 yield line.strip() | 130 yield line.strip() |
| 131 | 131 |
| 132 def ActIterator(lines): | 132 def ActIterator(lines): |
| 133 for line in lines: | 133 for line in lines: |
| 134 if self._IgnoreLine(line.strip()): continue | 134 if self._IgnoreLine(line.strip()): continue |
| 135 yield line.strip() | 135 yield line.strip() |
| 136 | 136 |
| 137 def ActBlockIterator(): | 137 def ActBlockIterator(): |
| 138 """Iterates over blocks of actual output lines.""" | 138 """Iterates over blocks of actual output lines.""" |
| 139 lines = output.stdout.splitlines() | 139 lines = testcase.output.stdout.splitlines() |
| 140 start_index = 0 | 140 start_index = 0 |
| 141 found_eqeq = False | 141 found_eqeq = False |
| 142 for index, line in enumerate(lines): | 142 for index, line in enumerate(lines): |
| 143 # If a stress test separator is found: | 143 # If a stress test separator is found: |
| 144 if line.startswith("=="): | 144 if line.startswith("=="): |
| 145 # Iterate over all lines before a separator except the first. | 145 # Iterate over all lines before a separator except the first. |
| 146 if not found_eqeq: | 146 if not found_eqeq: |
| 147 found_eqeq = True | 147 found_eqeq = True |
| 148 else: | 148 else: |
| 149 yield ActIterator(lines[start_index:index]) | 149 yield ActIterator(lines[start_index:index]) |
| 150 # The next block of ouput lines starts after the separator. | 150 # The next block of output lines starts after the separator. |
| 151 start_index = index + 1 | 151 start_index = index + 1 |
| 152 # Iterate over complete output if no separator was found. | 152 # Iterate over complete output if no separator was found. |
| 153 if not found_eqeq: | 153 if not found_eqeq: |
| 154 yield ActIterator(lines) | 154 yield ActIterator(lines) |
| 155 | 155 |
| 156 for act_iterator in ActBlockIterator(): | 156 for act_iterator in ActBlockIterator(): |
| 157 for (expected, actual) in itertools.izip_longest( | 157 for (expected, actual) in itertools.izip_longest( |
| 158 ExpIterator(), act_iterator, fillvalue=''): | 158 ExpIterator(), act_iterator, fillvalue=''): |
| 159 if expected != actual: | 159 if expected != actual: |
| 160 return True | 160 return True |
| 161 return False | 161 return False |
| 162 | 162 |
| 163 | 163 |
| 164 def GetSuite(name, root): | 164 def GetSuite(name, root): |
| 165 return WebkitTestSuite(name, root) | 165 return WebkitTestSuite(name, root) |
| OLD | NEW |