OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """A module to analyze test expectations for Webkit layout tests.""" | 5 """A module to analyze test expectations for Webkit layout tests.""" |
6 | 6 |
7 import urllib2 | 7 import urllib2 |
8 | 8 |
9 from webkitpy.layout_tests.models.test_expectations import * | 9 from webkitpy.layout_tests.models.test_expectations import * |
10 | 10 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 Returns: | 90 Returns: |
91 Tuple of test name, test expectations dictionary. See class documentation | 91 Tuple of test name, test expectations dictionary. See class documentation |
92 for the format of the dictionary | 92 for the format of the dictionary |
93 """ | 93 """ |
94 test_expectation_info = {} | 94 test_expectation_info = {} |
95 parsed = TestExpectationParser._tokenize_line('TestExpectations', line, 0) | 95 parsed = TestExpectationParser._tokenize_line('TestExpectations', line, 0) |
96 if parsed.is_invalid(): | 96 if parsed.is_invalid(): |
97 return None, None | 97 return None, None |
98 | 98 |
99 test_expectation_info['Comments'] = parsed.comment or '' | 99 test_expectation_info['Comments'] = parsed.comment or '' |
100 | 100 test_expectation_info['Bugs'] = parsed.bugs or []; |
101 # Split the modifiers dictionary into the format we want. | 101 test_expectation_info['Platforms'] = parsed.specifiers or [] |
102 remaining_modifiers = list(parsed.modifiers) | |
103 test_expectation_info['Bugs'] = [] | |
104 for m in parsed.modifiers: | |
105 if (m.startswith(WEBKIT_BUG_PREFIX) or | |
106 m.startswith(CHROMIUM_BUG_PREFIX) or | |
107 m.startswith(V8_BUG_PREFIX) or | |
108 m.startswith(NAMED_BUG_PREFIX)): | |
109 test_expectation_info['Bugs'].append(m) | |
110 remaining_modifiers.remove(m) | |
111 elif m in KNOWN_TE_KEYWORDS: | |
112 test_expectation_info[m] = True | |
113 remaining_modifiers.remove(m) | |
114 | |
115 # The modifiers left over should all be platform names. | |
116 test_expectation_info['Platforms'] = list(remaining_modifiers) | |
117 | |
118 # Shovel the expectations and modifiers in as "<key>: True" entries. Ugly, | 102 # Shovel the expectations and modifiers in as "<key>: True" entries. Ugly, |
119 # but required by the rest of the pipeline for parsing. | 103 # but required by the rest of the pipeline for parsing. |
120 for m in parsed.expectations + remaining_modifiers: | 104 for m in parsed.expectations: |
121 test_expectation_info[m] = True | 105 test_expectation_info[m] = True |
122 | 106 |
123 return parsed.name, test_expectation_info | 107 return parsed.name, test_expectation_info |
OLD | NEW |