Changeset 106692 in webkit
- Timestamp:
- Feb 3, 2012, 1:48:35 PM (15 years ago)
- Location:
- trunk/Tools
- Files:
-
- 7 edited
-
ChangeLog (modified) (1 diff)
-
Scripts/webkitpy/common/system/filesystem_mock.py (modified) (1 diff)
-
Scripts/webkitpy/layout_tests/port/base.py (modified) (1 diff)
-
Scripts/webkitpy/layout_tests/port/base_unittest.py (modified) (2 diffs)
-
Scripts/webkitpy/layout_tests/port/mock_drt.py (modified) (2 diffs)
-
Scripts/webkitpy/layout_tests/port/test.py (modified) (3 diffs)
-
Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r106687 r106692 1 2012-02-03 Ryosuke Niwa <rniwa@webkit.org> 2 3 Ref Tests should support plain SVG files 4 https://bugs.webkit.org/show_bug.cgi?id=77685 5 6 Reviewed by Tony Chang. 7 8 Don't assume reference files always use .html as the extension. 9 Instead, use the list of supported extension to look for -expected.* and -mismatch.* 10 11 Also fix various bugs in MockFileSystem and TestPort. 12 13 * Scripts/webkitpy/common/system/filesystem_mock.py: 14 (MockFileSystem.isdir): 15 * Scripts/webkitpy/layout_tests/port/base.py: 16 (Port.reference_files): 17 * Scripts/webkitpy/layout_tests/port/base_unittest.py: 18 (PortTest.test_is_test_file): 19 (PortTest.test_reference_files): 20 * Scripts/webkitpy/layout_tests/port/test.py: 21 (TestInstance.__init__): 22 1 23 2012-02-03 Ryosuke Niwa <rniwa@webkit.org> 2 24 -
trunk/Tools/Scripts/webkitpy/common/system/filesystem_mock.py
r104206 r106692 181 181 # mid-iteration. 182 182 files = self.files.keys()[:] 183 result = any(f.startswith(path) for f in files)183 result = any(f.startswith(path) and len(self.split(f)[0]) >= len(path) for f in files) 184 184 if result: 185 185 self.dirs.add(path) -
trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py
r106687 r106692 469 469 reftest_list = self._get_reftest_list(test_name) 470 470 if not reftest_list: 471 expected_filenames = [('==', self.expected_filename(test_name, '.html')), ('!=', self.expected_filename(test_name, '-mismatch.html'))] 472 return [(expectation, filename) for expectation, filename in expected_filenames if self._filesystem.exists(filename)] 471 reftest_list = [] 472 for expectation, prefix in (('==', ''), ('!=', '-mismatch')): 473 for extention in Port._supported_file_extensions: 474 path = self.expected_filename(test_name, prefix + extention) 475 if self._filesystem.exists(path): 476 reftest_list.append((expectation, path)) 477 return reftest_list 473 478 474 479 return reftest_list.get(self._filesystem.join(self.layout_tests_dir(), test_name), []) 475 476 def is_reftest(self, test_name):477 reftest_list = self._get_reftest_list(test_name)478 if not reftest_list:479 has_expected = self._filesystem.exists(self.expected_filename(test_name, '.html'))480 return has_expected or self._filesystem.exists(self.expected_filename(test_name, '-mismatch.html'))481 filename = self._filesystem.join(self.layout_tests_dir(), test_name)482 return filename in reftest_list483 480 484 481 def tests(self, paths): -
trunk/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py
r105644 r106692 325 325 self.assertTrue(Port._is_test_file(filesystem, '', 'foo.html')) 326 326 self.assertTrue(Port._is_test_file(filesystem, '', 'foo.shtml')) 327 self.assertTrue(Port._is_test_file(filesystem, '', 'foo.svg')) 327 328 self.assertTrue(Port._is_test_file(filesystem, '', 'test-ref-test.html')) 328 329 self.assertFalse(Port._is_test_file(filesystem, '', 'foo.png')) 329 330 self.assertFalse(Port._is_test_file(filesystem, '', 'foo-expected.html')) 331 self.assertFalse(Port._is_test_file(filesystem, '', 'foo-expected.svg')) 332 self.assertFalse(Port._is_test_file(filesystem, '', 'foo-expected.xht')) 330 333 self.assertFalse(Port._is_test_file(filesystem, '', 'foo-expected-mismatch.html')) 334 self.assertFalse(Port._is_test_file(filesystem, '', 'foo-expected-mismatch.svg')) 335 self.assertFalse(Port._is_test_file(filesystem, '', 'foo-expected-mismatch.xhtml')) 331 336 self.assertFalse(Port._is_test_file(filesystem, '', 'foo-ref.html')) 332 337 self.assertFalse(Port._is_test_file(filesystem, '', 'foo-notref.html')) … … 350 355 'bar/test-2.html': [('!=', 'bar/test-notref.html')], 351 356 'bar/test-3.html': [('==', 'bar/test-ref.html'), ('==', 'bar/test-ref2.html'), ('!=', 'bar/test-notref.html')]}) 357 358 def test_reference_files(self): 359 port = self.make_port(with_tests=True) 360 self.assertEqual(port.reference_files('passes/svgreftest.svg'), [('==', '/test.checkout/LayoutTests/passes/svgreftest-expected.svg')]) 361 self.assertEqual(port.reference_files('passes/xhtreftest.svg'), [('==', '/test.checkout/LayoutTests/passes/xhtreftest-expected.html')]) 362 self.assertEqual(port.reference_files('passes/phpreftest.php'), [('!=', '/test.checkout/LayoutTests/passes/phpreftest-expected-mismatch.svg')]) 352 363 353 364 def test_operating_system(self): -
trunk/Tools/Scripts/webkitpy/layout_tests/port/mock_drt.py
r106416 r106692 204 204 test_name = self._port.relative_test_filename(uri) 205 205 206 is_reftest = (self._port. is_reftest(test_name) or206 is_reftest = (self._port.reference_files(test_name) or 207 207 test_name.endswith('-expected.html') or 208 208 test_name.endswith('-mismatch.html')) … … 268 268 269 269 test_name = self._driver.uri_to_test(uri) 270 is_reftest = (self._port. is_reftest(test_name) or270 is_reftest = (self._port.reference_files(test_name) or 271 271 test_name.endswith('-expected.html') or 272 272 test_name.endswith('-mismatch.html')) -
trunk/Tools/Scripts/webkitpy/layout_tests/port/test.py
r105381 r106692 45 45 def __init__(self, name): 46 46 self.name = name 47 self.base = name[(name.rfind("/") + 1):name.rfind(". html")]47 self.base = name[(name.rfind("/") + 1):name.rfind(".")] 48 48 self.crash = False 49 49 self.web_process_crash = False … … 183 183 tests.add_reftest('passes/reftest.html', 'passes/reftest-expected.html', same_image=True) 184 184 tests.add_reftest('passes/mismatch.html', 'passes/mismatch-expected-mismatch.html', same_image=False) 185 tests.add_reftest('passes/svgreftest.svg', 'passes/svgreftest-expected.svg', same_image=True) 186 tests.add_reftest('passes/xhtreftest.xht', 'passes/xhtreftest-expected.html', same_image=True) 187 tests.add_reftest('passes/phpreftest.php', 'passes/phpreftest-expected-mismatch.svg', same_image=False) 185 188 tests.add_reftest('failures/expected/reftest.html', 'failures/expected/reftest-expected.html', same_image=False) 186 189 tests.add_reftest('failures/expected/mismatch.html', 'failures/expected/mismatch-expected-mismatch.html', same_image=True) … … 293 296 test_list = unit_test_list() 294 297 for test in test_list.tests.values(): 295 add_file(test, '.html', '')298 add_file(test, test.name[test.name.rfind('.'):], '') 296 299 if test.is_reftest: 297 300 continue -
trunk/Tools/Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests.py
r104416 r106692 248 248 fs = self._target_port._filesystem 249 249 for test in self._rebaselining_tests: 250 if self._target_port. is_reftest(test):250 if self._target_port.reference_files(test): 251 251 _log.error('%s seems to be a reftest. We can not rebase for reftests.', test) 252 252 self._rebaselining_tests = set()
Note:
See TracChangeset
for help on using the changeset viewer.