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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 parsed_specifiers = set([specifier.lower() for specifier in expectation_
line.specifiers]) | 149 parsed_specifiers = set([specifier.lower() for specifier in expectation_
line.specifiers]) |
150 expectation_line.matching_configurations = self._test_configuration_conv
erter.to_config_set(parsed_specifiers, expectation_line.warnings) | 150 expectation_line.matching_configurations = self._test_configuration_conv
erter.to_config_set(parsed_specifiers, expectation_line.warnings) |
151 | 151 |
152 def _lint_line(self, expectation_line): | 152 def _lint_line(self, expectation_line): |
153 expectations = [expectation.lower() for expectation in expectation_line.
expectations] | 153 expectations = [expectation.lower() for expectation in expectation_line.
expectations] |
154 if not expectation_line.bugs and self.WONTFIX_MODIFIER not in expectatio
ns: | 154 if not expectation_line.bugs and self.WONTFIX_MODIFIER not in expectatio
ns: |
155 expectation_line.warnings.append(self.MISSING_BUG_WARNING) | 155 expectation_line.warnings.append(self.MISSING_BUG_WARNING) |
156 if self.REBASELINE_MODIFIER in expectations: | 156 if self.REBASELINE_MODIFIER in expectations: |
157 expectation_line.warnings.append('REBASELINE should only be used for
running rebaseline.py. Cannot be checked in.') | 157 expectation_line.warnings.append('REBASELINE should only be used for
running rebaseline.py. Cannot be checked in.') |
158 | 158 |
| 159 if self.NEEDS_REBASELINE_MODIFIER in expectations or self.NEEDS_MANUAL_R
EBASELINE_MODIFIER in expectations: |
| 160 for test in expectation_line.matching_tests: |
| 161 if self._port.reference_files(test): |
| 162 expectation_line.warnings.append('A reftest cannot be marked
as NeedsRebaseline/NeedsManualRebaseline') |
| 163 |
159 def _parse_expectations(self, expectation_line): | 164 def _parse_expectations(self, expectation_line): |
160 result = set() | 165 result = set() |
161 for part in expectation_line.expectations: | 166 for part in expectation_line.expectations: |
162 expectation = TestExpectations.expectation_from_string(part) | 167 expectation = TestExpectations.expectation_from_string(part) |
163 if expectation is None: # Careful, PASS is currently 0. | 168 if expectation is None: # Careful, PASS is currently 0. |
164 expectation_line.warnings.append('Unsupported expectation: %s' %
part) | 169 expectation_line.warnings.append('Unsupported expectation: %s' %
part) |
165 continue | 170 continue |
166 result.add(expectation) | 171 result.add(expectation) |
167 expectation_line.parsed_expectations = result | 172 expectation_line.parsed_expectations = result |
168 | 173 |
(...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1095 # If reconstitute_only_these is an empty list, we want to return ori
ginal_string. | 1100 # If reconstitute_only_these is an empty list, we want to return ori
ginal_string. |
1096 # So we need to compare reconstitute_only_these to None, not just ch
eck if it's falsey. | 1101 # So we need to compare reconstitute_only_these to None, not just ch
eck if it's falsey. |
1097 if reconstitute_only_these is None or expectation_line in reconstitu
te_only_these: | 1102 if reconstitute_only_these is None or expectation_line in reconstitu
te_only_these: |
1098 return expectation_line.to_string(test_configuration_converter) | 1103 return expectation_line.to_string(test_configuration_converter) |
1099 return expectation_line.original_string | 1104 return expectation_line.original_string |
1100 | 1105 |
1101 def nones_out(expectation_line): | 1106 def nones_out(expectation_line): |
1102 return expectation_line is not None | 1107 return expectation_line is not None |
1103 | 1108 |
1104 return "\n".join(filter(nones_out, map(serialize, expectation_lines))) | 1109 return "\n".join(filter(nones_out, map(serialize, expectation_lines))) |
OLD | NEW |