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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 def is_comment(self): | 273 def is_comment(self): |
274 return bool(re.match(r"^\s*#.*$", self.original_string)) | 274 return bool(re.match(r"^\s*#.*$", self.original_string)) |
275 | 275 |
276 def is_whitespace(self): | 276 def is_whitespace(self): |
277 return not self.original_string.strip() | 277 return not self.original_string.strip() |
278 | 278 |
279 # FIXME: Update the original specifiers and remove this once the old syntax
is gone. | 279 # FIXME: Update the original specifiers and remove this once the old syntax
is gone. |
280 _configuration_tokens_list = [ | 280 _configuration_tokens_list = [ |
281 'Mac', 'Mac10.9', 'Mac10.10', 'Mac10.11', 'Retina', | 281 'Mac', 'Mac10.9', 'Mac10.10', 'Mac10.11', 'Retina', |
282 'Win', 'Win7', 'Win10', | 282 'Win', 'Win7', 'Win10', |
283 'Linux', 'Precise', 'Trusty', | 283 'Linux', 'Trusty', |
284 'Android', | 284 'Android', |
285 'Release', | 285 'Release', |
286 'Debug', | 286 'Debug', |
287 ] | 287 ] |
288 | 288 |
289 _configuration_tokens = dict((token, token.upper()) for token in _configurat
ion_tokens_list) | 289 _configuration_tokens = dict((token, token.upper()) for token in _configurat
ion_tokens_list) |
290 _inverted_configuration_tokens = dict((value, name) for name, value in _conf
iguration_tokens.iteritems()) | 290 _inverted_configuration_tokens = dict((value, name) for name, value in _conf
iguration_tokens.iteritems()) |
291 | 291 |
292 # FIXME: Update the original specifiers list and remove this once the old sy
ntax is gone. | 292 # FIXME: Update the original specifiers list and remove this once the old sy
ntax is gone. |
293 _expectation_tokens = { | 293 _expectation_tokens = { |
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1206 # If reconstitute_only_these is an empty list, we want to return ori
ginal_string. | 1206 # If reconstitute_only_these is an empty list, we want to return ori
ginal_string. |
1207 # So we need to compare reconstitute_only_these to None, not just ch
eck if it's falsey. | 1207 # So we need to compare reconstitute_only_these to None, not just ch
eck if it's falsey. |
1208 if reconstitute_only_these is None or expectation_line in reconstitu
te_only_these: | 1208 if reconstitute_only_these is None or expectation_line in reconstitu
te_only_these: |
1209 return expectation_line.to_string(test_configuration_converter) | 1209 return expectation_line.to_string(test_configuration_converter) |
1210 return expectation_line.original_string | 1210 return expectation_line.original_string |
1211 | 1211 |
1212 def nones_out(expectation_line): | 1212 def nones_out(expectation_line): |
1213 return expectation_line is not None | 1213 return expectation_line is not None |
1214 | 1214 |
1215 return '\n'.join(filter(nones_out, map(serialize, expectation_lines))) | 1215 return '\n'.join(filter(nones_out, map(serialize, expectation_lines))) |
OLD | NEW |