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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py

Issue 1346673003: Allow text expectation for reftests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 4 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright (C) 2010 Google Inc. All rights reserved. 1 # Copyright (C) 2010 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 def _lint_line(self, expectation_line): 166 def _lint_line(self, expectation_line):
167 expectations = [expectation.lower() for expectation in expectation_line. expectations] 167 expectations = [expectation.lower() for expectation in expectation_line. expectations]
168 if not expectation_line.bugs and self.WONTFIX_MODIFIER not in expectatio ns: 168 if not expectation_line.bugs and self.WONTFIX_MODIFIER not in expectatio ns:
169 expectation_line.warnings.append(self.MISSING_BUG_WARNING) 169 expectation_line.warnings.append(self.MISSING_BUG_WARNING)
170 if self.REBASELINE_MODIFIER in expectations: 170 if self.REBASELINE_MODIFIER in expectations:
171 expectation_line.warnings.append('REBASELINE should only be used for running rebaseline.py. Cannot be checked in.') 171 expectation_line.warnings.append('REBASELINE should only be used for running rebaseline.py. Cannot be checked in.')
172 172
173 if self.NEEDS_REBASELINE_MODIFIER in expectations or self.NEEDS_MANUAL_R EBASELINE_MODIFIER in expectations: 173 if self.NEEDS_REBASELINE_MODIFIER in expectations or self.NEEDS_MANUAL_R EBASELINE_MODIFIER in expectations:
174 for test in expectation_line.matching_tests: 174 for test in expectation_line.matching_tests:
175 if self._port.reference_files(test): 175 if self._port.reference_files(test):
176 expectation_line.warnings.append('A reftest cannot be marked as NeedsRebaseline/NeedsManualRebaseline') 176 text_expected_filename = self._port.expected_filename(test, '.txt')
177 if not self._port.host.filesystem.exists(text_expected_filen ame):
178 expectation_line.warnings.append('A reftest without text expectation cannot be marked as NeedsRebaseline/NeedsManualRebaseline')
177 179
178 specifiers = [specifier.lower() for specifier in expectation_line.specif iers] 180 specifiers = [specifier.lower() for specifier in expectation_line.specif iers]
179 if (self.REBASELINE_MODIFIER in expectations or self.NEEDS_REBASELINE_MO DIFIER in expectations) and ('debug' in specifiers or 'release' in specifiers): 181 if (self.REBASELINE_MODIFIER in expectations or self.NEEDS_REBASELINE_MO DIFIER in expectations) and ('debug' in specifiers or 'release' in specifiers):
180 expectation_line.warnings.append('A test cannot be rebaselined for D ebug/Release.') 182 expectation_line.warnings.append('A test cannot be rebaselined for D ebug/Release.')
181 183
182 def _parse_expectations(self, expectation_line): 184 def _parse_expectations(self, expectation_line):
183 result = set() 185 result = set()
184 for part in expectation_line.expectations: 186 for part in expectation_line.expectations:
185 expectation = TestExpectations.expectation_from_string(part) 187 expectation = TestExpectations.expectation_from_string(part)
186 if expectation is None: # Careful, PASS is currently 0. 188 if expectation is None: # Careful, PASS is currently 0.
(...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after
1164 # If reconstitute_only_these is an empty list, we want to return ori ginal_string. 1166 # If reconstitute_only_these is an empty list, we want to return ori ginal_string.
1165 # So we need to compare reconstitute_only_these to None, not just ch eck if it's falsey. 1167 # So we need to compare reconstitute_only_these to None, not just ch eck if it's falsey.
1166 if reconstitute_only_these is None or expectation_line in reconstitu te_only_these: 1168 if reconstitute_only_these is None or expectation_line in reconstitu te_only_these:
1167 return expectation_line.to_string(test_configuration_converter) 1169 return expectation_line.to_string(test_configuration_converter)
1168 return expectation_line.original_string 1170 return expectation_line.original_string
1169 1171
1170 def nones_out(expectation_line): 1172 def nones_out(expectation_line):
1171 return expectation_line is not None 1173 return expectation_line is not None
1172 1174
1173 return "\n".join(filter(nones_out, map(serialize, expectation_lines))) 1175 return "\n".join(filter(nones_out, map(serialize, expectation_lines)))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698