Changeset 92087 in webkit
- Timestamp:
- Jul 31, 2011 1:40:55 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r92077 r92087 1 2011-07-31 Dimitri Glazkov <dglazkov@chromium.org> 2 3 Use set comparison to find duplicate or overlapping specifiers in test expectations. 4 https://bugs.webkit.org/show_bug.cgi?id=65430 5 6 Reviewed by Adam Barth. 7 8 * Scripts/webkitpy/layout_tests/models/test_expectations.py: Changed to use set comparisons, because length 9 of a set is wrong. 10 * Scripts/webkitpy/style/checkers/test_expectations_unittest.py: Added some unit tests to actually catch 11 regressions. 12 1 13 2011-07-31 Xan Lopez <xlopez@igalia.com> 2 14 -
trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
r91884 r92087 528 528 # to be warnings and return False". 529 529 530 prev_specificity = len(prev_expectation_line.matching_configurations) 531 specificity = len(prev_expectation_line.matching_configurations) 532 if prev_specificity == specificity: 530 if prev_expectation_line.matching_configurations == expectation_line.matching_configurations: 533 531 expectation_line.errors.append('Duplicate or ambiguous %s.' % expectation_source) 534 532 return True 535 533 536 if prev_ specificity < specificity:534 if prev_expectation_line.matching_configurations >= expectation_line.matching_configurations: 537 535 expectation_line.errors.append('More specific entry on line %d overrides line %d' % (expectation_line.line_number, prev_expectation_line.line_number)) 538 536 # FIXME: return False if we want more specific to win. 539 537 return True 540 538 541 expectation_line.errors.append('More specific entry on line %d overrides line %d' % (prev_expectation_line.line_number, expectation_line.line_number)) 542 return True 539 if prev_expectation_line.matching_configurations <= expectation_line.matching_configurations: 540 expectation_line.errors.append('More specific entry on line %d overrides line %d' % (prev_expectation_line.line_number, expectation_line.line_number)) 541 return True 542 543 if prev_expectation_line.matching_configurations & expectation_line.matching_configurations: 544 expectation_line.errors.append('Entries on line %d and line %d match overlapping sets of configurations' % (prev_expectation_line.line_number, expectation_line.line_number)) 545 return True 546 547 # Configuration sets are disjoint, then. 548 return False 543 549 544 550 -
trunk/Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py
r91103 r92087 152 152 "Duplicate or ambiguous expectation. %s [test/expectations] [5]" % self._test_file) 153 153 154 self.assert_lines_lint( 155 ["BUGWK1 LEOPARD : passes/text.html = PASS", 156 "BUGWK1 MAC : passes/text.html = TIMEOUT"], 157 "More specific entry on line 1 overrides line 2 passes/text.html [test/expectations] [5]") 158 159 self.assert_lines_lint( 160 ["BUGWK1 LEOPARD : passes/text.html = PASS", 161 "BUGWK1 LEOPARD RELEASE : passes/text.html = TIMEOUT"], 162 "More specific entry on line 2 overrides line 1 passes/text.html [test/expectations] [5]") 163 164 self.assert_lines_lint( 165 ["BUGWK1 RELEASE : passes/text.html = PASS", 166 "BUGWK1 CPU : passes/text.html = TIMEOUT"], 167 "Entries on line 1 and line 2 match overlapping sets of configurations passes/text.html [test/expectations] [5]") 168 169 self.assert_lines_lint( 170 ["BUGWK1 WIN : passes/text.html = PASS", 171 "BUGWK1 MAC : passes/text.html = TIMEOUT"], 172 "") 173 174 self.assert_lines_lint( 175 ["BUGWK1 LEOPARD DEBUG : passes/text.html = PASS", 176 "BUGWK1 LEOPARD RELEASE : passes/text.html = TIMEOUT"], 177 "") 178 179 154 180 def test_tab(self): 155 181 self.assert_lines_lint(
Note: See TracChangeset
for help on using the changeset viewer.