| OLD | NEW |
| 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 expectation_line.matching_configurations = self._test_configuration_conv
erter.to_config_set( | 163 expectation_line.matching_configurations = self._test_configuration_conv
erter.to_config_set( |
| 164 parsed_specifiers, expectation_line.warnings) | 164 parsed_specifiers, expectation_line.warnings) |
| 165 | 165 |
| 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 # TODO(crbug.com/603753) - Don't let NeedsRebaseline be checked in while
the auto-rebaseline-bot is down. |
| 174 if self.NEEDS_REBASELINE_MODIFIER in expectations: |
| 175 expectation_line.warnings.append('NeedsRebaseline is broken at the m
oment. See crbug.com/603753.') |
| 176 |
| 173 if self.NEEDS_REBASELINE_MODIFIER in expectations or self.NEEDS_MANUAL_R
EBASELINE_MODIFIER in expectations: | 177 if self.NEEDS_REBASELINE_MODIFIER in expectations or self.NEEDS_MANUAL_R
EBASELINE_MODIFIER in expectations: |
| 174 for test in expectation_line.matching_tests: | 178 for test in expectation_line.matching_tests: |
| 175 if self._port.reference_files(test): | 179 if self._port.reference_files(test): |
| 176 expectation_line.warnings.append('A reftest cannot be marked
as NeedsRebaseline/NeedsManualRebaseline') | 180 expectation_line.warnings.append('A reftest cannot be marked
as NeedsRebaseline/NeedsManualRebaseline') |
| 177 | 181 |
| 178 specifiers = [specifier.lower() for specifier in expectation_line.specif
iers] | 182 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): | 183 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.') | 184 expectation_line.warnings.append('A test cannot be rebaselined for D
ebug/Release.') |
| 181 | 185 |
| 182 def _parse_expectations(self, expectation_line): | 186 def _parse_expectations(self, expectation_line): |
| (...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1164 # If reconstitute_only_these is an empty list, we want to return ori
ginal_string. | 1168 # 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. | 1169 # 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: | 1170 if reconstitute_only_these is None or expectation_line in reconstitu
te_only_these: |
| 1167 return expectation_line.to_string(test_configuration_converter) | 1171 return expectation_line.to_string(test_configuration_converter) |
| 1168 return expectation_line.original_string | 1172 return expectation_line.original_string |
| 1169 | 1173 |
| 1170 def nones_out(expectation_line): | 1174 def nones_out(expectation_line): |
| 1171 return expectation_line is not None | 1175 return expectation_line is not None |
| 1172 | 1176 |
| 1173 return "\n".join(filter(nones_out, map(serialize, expectation_lines))) | 1177 return "\n".join(filter(nones_out, map(serialize, expectation_lines))) |
| OLD | NEW |