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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 expectation_line.expectations = expectations | 120 expectation_line.expectations = expectations |
121 return expectation_line | 121 return expectation_line |
122 | 122 |
123 def expectation_line_for_test(self, test_name, expectations): | 123 def expectation_line_for_test(self, test_name, expectations): |
124 expectation_line = self._create_expectation_line(test_name, expectations
, '<Bot TestExpectations>') | 124 expectation_line = self._create_expectation_line(test_name, expectations
, '<Bot TestExpectations>') |
125 self._parse_line(expectation_line) | 125 self._parse_line(expectation_line) |
126 return expectation_line | 126 return expectation_line |
127 | 127 |
128 def expectation_for_skipped_test(self, test_name): | 128 def expectation_for_skipped_test(self, test_name): |
129 if not self._port.test_exists(test_name): | 129 if not self._port.test_exists(test_name): |
130 _log.warning('The following test %s from the Skipped list doesn\'t e
xist' % test_name) | 130 _log.warning('The following test %s from the Skipped list doesn\'t e
xist', test_name) |
131 expectation_line = self._create_expectation_line(test_name, [TestExpecta
tionParser.PASS_EXPECTATION], '<Skipped file>') | 131 expectation_line = self._create_expectation_line(test_name, [TestExpecta
tionParser.PASS_EXPECTATION], '<Skipped file>') |
132 expectation_line.expectations = [TestExpectationParser.SKIP_MODIFIER, Te
stExpectationParser.WONTFIX_MODIFIER] | 132 expectation_line.expectations = [TestExpectationParser.SKIP_MODIFIER, Te
stExpectationParser.WONTFIX_MODIFIER] |
133 expectation_line.is_skipped_outside_expectations_file = True | 133 expectation_line.is_skipped_outside_expectations_file = True |
134 self._parse_line(expectation_line) | 134 self._parse_line(expectation_line) |
135 return expectation_line | 135 return expectation_line |
136 | 136 |
137 def _parse_line(self, expectation_line): | 137 def _parse_line(self, expectation_line): |
138 if not expectation_line.name: | 138 if not expectation_line.name: |
139 return | 139 return |
140 | 140 |
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1189 # If reconstitute_only_these is an empty list, we want to return ori
ginal_string. | 1189 # If reconstitute_only_these is an empty list, we want to return ori
ginal_string. |
1190 # So we need to compare reconstitute_only_these to None, not just ch
eck if it's falsey. | 1190 # So we need to compare reconstitute_only_these to None, not just ch
eck if it's falsey. |
1191 if reconstitute_only_these is None or expectation_line in reconstitu
te_only_these: | 1191 if reconstitute_only_these is None or expectation_line in reconstitu
te_only_these: |
1192 return expectation_line.to_string(test_configuration_converter) | 1192 return expectation_line.to_string(test_configuration_converter) |
1193 return expectation_line.original_string | 1193 return expectation_line.original_string |
1194 | 1194 |
1195 def nones_out(expectation_line): | 1195 def nones_out(expectation_line): |
1196 return expectation_line is not None | 1196 return expectation_line is not None |
1197 | 1197 |
1198 return "\n".join(filter(nones_out, map(serialize, expectation_lines))) | 1198 return "\n".join(filter(nones_out, map(serialize, expectation_lines))) |
OLD | NEW |