Changeset 101979 in webkit
- Timestamp:
- Dec 5, 2011, 1:28:10 AM (14 years ago)
- Location:
- trunk/Tools
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r101973 r101979 1 2011-12-05 Kristóf Kosztyó <kkristof@inf.u-szeged.hu> 2 3 NRWT should handle duplicated expectations 4 https://bugs.webkit.org/show_bug.cgi?id=69750 5 6 Reviewed by Dirk Pranke. 7 8 * Scripts/webkitpy/layout_tests/models/test_expectations.py: 9 (TestExpectations.__init__): 10 (TestExpectations._report_errors): 11 (TestExpectations._add_expectations): 12 * Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py: 13 (test_add_skipped_tests): 14 * Scripts/webkitpy/layout_tests/port/base.py: 15 (Port.skipped_tests): 16 * Scripts/webkitpy/layout_tests/port/webkit.py: 17 (WebKitPort.test_expectations): 18 (WebKitPort.skipped_tests): 19 * Scripts/webkitpy/layout_tests/port/webkit_unittest.py: 20 (test_test_expectations): 21 1 22 2011-12-04 Eric Seidel <eric@webkit.org> 2 23 -
trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
r98666 r101979 698 698 self._port = port 699 699 self._test_configuration_converter = TestConfigurationConverter(port.all_test_configurations(), port.configuration_specifier_macros()) 700 self._skipped_tests_warnings = [] 700 701 701 702 self._expectations = TestExpectationParser.tokenize_list(expectations) 702 703 self._add_expectations(self._expectations, overrides_allowed=False) 704 self._add_skipped_tests(port.skipped_tests()) 703 705 704 706 if overrides: … … 784 786 warnings.append("Line:%s %s %s" % (expectation.line_number, warning, expectation.name if expectation.expectations else expectation.original_string)) 785 787 788 for warning in self._skipped_tests_warnings: 789 warnings.append(warning) 790 786 791 if len(errors) or len(warnings): 787 792 webkit_base_path = self._port.webkit_base() … … 827 832 if self._test_config in expectation_line.matching_configurations: 828 833 self._model.add_expectation_line(expectation_line, overrides_allowed) 834 835 def _add_skipped_tests(self, tests_to_skip): 836 if not tests_to_skip: 837 return 838 for index, test in enumerate(self._expectations, start=1): 839 if test.name and test.name in tests_to_skip: 840 self._skipped_tests_warnings.append('The %s test from test_expectations.txt in line %d is also in Skipped!' % 841 (test.name, index)) 842 skipped_tests = '\n'.join(map(lambda test_path: 'BUG_SKIPPED SKIP : %s = FAIL' % test_path, tests_to_skip)) 843 for test in TestExpectationParser.tokenize_list(skipped_tests): 844 self._parser.parse(test) 845 self._model.add_expectation_line(test, overrides_allowed=True) -
trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py
r99233 r101979 257 257 self._exp.get_tests_with_result_type(SKIP)) 258 258 259 def test_add_skipped_tests(self): 260 port = MockHost().port_factory.get('qt') 261 port._filesystem.files[port._filesystem.join(port.layout_tests_dir(), 'platform/qt/Skipped')] = 'failures/expected/text.html' 262 port._filesystem.files[port._filesystem.join(port.layout_tests_dir(), 'failures/expected/text.html')] = 'foo' 263 self.assertRaises(ParseError, TestExpectations, port, 'failures/expected/text.html\n', 'BUGX : failures/expected/text.html = text\n', None, True) 264 265 259 266 class ExpectationSyntaxTests(Base): 260 267 def test_missing_expectation(self): -
trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py
r101845 r101979 610 610 return [] 611 611 612 def skipped_tests(self): 613 return [] 614 612 615 def skips_layout_test(self, test_name): 613 616 """Figures out if the givent test is being skipped or not. -
trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py
r101739 r101979 361 361 def test_expectations(self): 362 362 # This allows ports to use a combination of test_expectations.txt files and Skipped lists. 363 expectations = self._skipped_list_as_expectations()363 expectations = '' 364 364 expectations_path = self.path_to_test_expectations_file() 365 365 if self._filesystem.exists(expectations_path): 366 366 _log.debug("Using test_expectations.txt: %s" % expectations_path) 367 expectations = self._filesystem.read_text_file(expectations_path) + '\n' + expectations367 expectations = self._filesystem.read_text_file(expectations_path) 368 368 return expectations 369 370 def _skipped_list_as_expectations(self):371 # Each Skipped file contains a list of files372 # or directories to be skipped during the test run. The total list373 # of tests to skipped is given by the contents of the generic374 # Skipped file found in platform/X plus a version-specific file375 # found in platform/X-version. Duplicate entries are allowed.376 # This routine reads those files and turns contents into the377 # format expected by test_expectations.378 379 tests_to_skip = self.skipped_layout_tests()380 skip_lines = map(lambda test_path: "BUG_SKIPPED SKIP : %s = FAIL" % test_path, tests_to_skip)381 return "\n".join(skip_lines)382 369 383 370 def skipped_layout_tests(self): … … 387 374 tests_to_skip.update(self._skipped_tests_for_unsupported_features()) 388 375 return tests_to_skip 376 377 def skipped_tests(self): 378 return self.skipped_layout_tests() 389 379 390 380 def _build_path(self, *comps): -
trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py
r101534 r101979 149 149 150 150 def test_test_expectations(self): 151 # Check that we read both the expectations file and anything in a 152 # Skipped file, and that we include the feature and platform checks. 151 # Check that we read the expectations file 153 152 files = { 154 153 '/mock-checkout/LayoutTests/platform/testwebkitport/test_expectations.txt': 'BUG_TESTEXPECTATIONS SKIP : fast/html/article-element.html = FAIL\n', 155 '/mock-checkout/LayoutTests/platform/testwebkitport/Skipped': 'fast/html/keygen.html',156 154 } 157 155 mock_fs = MockFileSystem(files) 158 156 port = TestWebKitPort(filesystem=mock_fs) 159 self.assertEqual(port.test_expectations(), 160 """BUG_TESTEXPECTATIONS SKIP : fast/html/article-element.html = FAIL\n 161 BUG_SKIPPED SKIP : fast/html/keygen.html = FAIL 162 BUG_SKIPPED SKIP : media = FAIL""") 163 files = { 164 '/mock-checkout/LayoutTests/platform/testwebkitport/test_expectations.txt': 'BUG_TESTEXPECTATIONS SKIP : fast/html/article-element.html = FAIL', 165 '/mock-checkout/LayoutTests/platform/testwebkitport/Skipped': 'fast/html/keygen.html', 166 } 167 mock_fs = MockFileSystem(files) 168 port = TestWebKitPort(filesystem=mock_fs) 169 self.assertEqual(port.test_expectations(), 170 """BUG_TESTEXPECTATIONS SKIP : fast/html/article-element.html = FAIL 171 BUG_SKIPPED SKIP : fast/html/keygen.html = FAIL 172 BUG_SKIPPED SKIP : media = FAIL""") 173 157 self.assertEqual(port.test_expectations(), 'BUG_TESTEXPECTATIONS SKIP : fast/html/article-element.html = FAIL\n') 174 158 175 159 def test_build_driver(self):
Note:
See TracChangeset
for help on using the changeset viewer.