Diff
Modified: trunk/Tools/ChangeLog (120248 => 120249)
--- trunk/Tools/ChangeLog 2012-06-13 21:09:57 UTC (rev 120248)
+++ trunk/Tools/ChangeLog 2012-06-13 21:35:31 UTC (rev 120249)
@@ -1,3 +1,28 @@
+2012-06-13 Ryosuke Niwa <[email protected]>
+
+ Remove webkitpy code to support legacy test_expectations.txt files
+ https://bugs.webkit.org/show_bug.cgi?id=89038
+
+ Reviewed by Dirk Pranke.
+
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ (Port.path_to_test_expectations_file):
+ (Port.expectations_dict):
+ * Scripts/webkitpy/layout_tests/port/base_unittest.py:
+ (PortTest.test_uses_test_expectations_file):
+ * Scripts/webkitpy/layout_tests/port/webkit_unittest.py:
+ (WebKitPortTest.test_path_to_test_expectations_file):
+ (test_test_expectations):
+ * Scripts/webkitpy/style/checker.py:
+ (CheckerDispatcher.should_skip_without_warning):
+ (CheckerDispatcher._create_checker):
+ * Scripts/webkitpy/style/checkers/test_expectations_unittest.py:
+ (TestExpectationsTestCase._expect_port_for_expectations_path):
+ * Scripts/webkitpy/tool/steps/commit.py:
+ (Commit._check_test_expectations):
+ * Scripts/webkitpy/tool/steps/commit_unittest.py:
+ (CommitTest.test_check_test_expectations):
+
2012-06-13 Dirk Pranke <[email protected]>
nrwt: remove port.test_expectations() and port.test_expectations_overrides()
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py (120248 => 120249)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py 2012-06-13 21:09:57 UTC (rev 120248)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py 2012-06-13 21:35:31 UTC (rev 120249)
@@ -696,11 +696,7 @@
if port_name.startswith('chromium') or port_name.startswith('google-chrome'):
port_name = 'chromium'
- baseline_path = self._webkit_baseline_path(port_name)
- old_expectations_file = self._filesystem.join(baseline_path, 'test_expectations.txt')
- if self._filesystem.exists(old_expectations_file):
- return old_expectations_file
- return self._filesystem.join(baseline_path, 'TestExpectations')
+ return self._filesystem.join(self._webkit_baseline_path(port_name), 'TestExpectations')
def relative_test_filename(self, filename):
"""Returns a test_name a realtive unix-style path for a filename under the LayoutTests
@@ -897,14 +893,13 @@
return self._filesystem.exists(self.path_to_test_expectations_file())
def expectations_dict(self):
- """Returns an OrderedDict of name -> expectations strings. The names
- are expected to be (but not required to be) paths in the filesystem.
- If the name is a path, the file can be considered updatable for things
- like rebaselining, so don't use names that are paths if they're not paths.
- Generally speaking the ordering should be files in the filesystem in
- cascade order (test_expectations.txt followed by Skipped, if the port
- honors both formats), then any built-in expectations (e.g., from compile-time
- exclusions), then --additional-expectations options."""
+ """Returns an OrderedDict of name -> expectations strings.
+ The names are expected to be (but not required to be) paths in the filesystem.
+ If the name is a path, the file can be considered updatable for things like rebaselining,
+ so don't use names that are paths if they're not paths.
+ Generally speaking the ordering should be files in the filesystem in cascade order
+ (TestExpectations followed by Skipped, if the port honors both formats),
+ then any built-in expectations (e.g., from compile-time exclusions), then --additional-expectations options."""
# FIXME: rename this to test_expectations() once all the callers are updated to know about the ordered dict.
expectations = OrderedDict()
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py (120248 => 120249)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py 2012-06-13 21:09:57 UTC (rev 120248)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py 2012-06-13 21:35:31 UTC (rev 120249)
@@ -304,9 +304,9 @@
def test_uses_test_expectations_file(self):
port = self.make_port(port_name='foo')
port.port_name = 'foo'
- port.path_to_test_expectations_file = lambda: '/mock-results/test_expectations.txt'
+ port.path_to_test_expectations_file = lambda: '/mock-results/TestExpectations'
self.assertFalse(port.uses_test_expectations_file())
- port._filesystem = MockFileSystem({'/mock-results/test_expectations.txt': ''})
+ port._filesystem = MockFileSystem({'/mock-results/TestExpectations': ''})
self.assertTrue(port.uses_test_expectations_file())
def test_find_no_paths_specified(self):
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py (120248 => 120249)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py 2012-06-13 21:09:57 UTC (rev 120248)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py 2012-06-13 21:35:31 UTC (rev 120249)
@@ -101,9 +101,9 @@
self.assertEqual(port.path_to_test_expectations_file(), '/mock-checkout/LayoutTests/platform/testwebkitport/TestExpectations')
port = TestWebKitPort()
- port.host.filesystem.files['/mock-checkout/LayoutTests/platform/testwebkitport/test_expectations.txt'] = 'some content'
+ port.host.filesystem.files['/mock-checkout/LayoutTests/platform/testwebkitport/TestExpectations'] = 'some content'
port._options = MockOptions(webkit_test_runner=False)
- self.assertEqual(port.path_to_test_expectations_file(), '/mock-checkout/LayoutTests/platform/testwebkitport/test_expectations.txt')
+ self.assertEqual(port.path_to_test_expectations_file(), '/mock-checkout/LayoutTests/platform/testwebkitport/TestExpectations')
def test_skipped_directories_for_symbols(self):
# This first test confirms that the commonly found symbols result in the expected skipped directories.
@@ -177,16 +177,6 @@
port = TestWebKitPort(host=host)
self.assertEqual(''.join(port.expectations_dict().values()), 'BUG_TESTEXPECTATIONS SKIP : fast/html/article-element.html = FAIL\n')
- def test_legacy_test_expectations(self):
- # Check that we read the legacy test_expectations.txt file
- host = MockSystemHost()
- host.filesystem.write_text_file('/mock-checkout/LayoutTests/platform/testwebkitport/test_expectations.txt',
- 'BUG_TESTEXPECTATIONS SKIP : fast/html/article-element.html = FAIL\n')
- host.filesystem.write_text_file('/mock-checkout/LayoutTests/platform/testwebkitport/TestExpectations',
- 'BUG_BADEXPECTATION SKIP : fast/html/article-element.html = FAIL\n')
- port = TestWebKitPort(host=host)
- self.assertEqual(''.join(port.expectations_dict().values()), 'BUG_TESTEXPECTATIONS SKIP : fast/html/article-element.html = FAIL\n')
-
def test_build_driver(self):
output = OutputCapture()
port = TestWebKitPort()
Modified: trunk/Tools/Scripts/webkitpy/style/checker.py (120248 => 120249)
--- trunk/Tools/Scripts/webkitpy/style/checker.py 2012-06-13 21:09:57 UTC (rev 120248)
+++ trunk/Tools/Scripts/webkitpy/style/checker.py 2012-06-13 21:35:31 UTC (rev 120249)
@@ -530,7 +530,7 @@
basename = os.path.basename(file_path)
if basename.startswith('ChangeLog'):
return False
- elif basename == 'test_expectations.txt' or basename == 'TestExpectations':
+ elif basename == 'TestExpectations':
return False
for skipped_file in _SKIPPED_FILES_WITHOUT_WARNING:
if self._should_skip_file_path(file_path, skipped_file):
@@ -598,7 +598,7 @@
checker = PNGChecker(file_path, handle_style_error)
elif file_type == FileType.TEXT:
basename = os.path.basename(file_path)
- if basename == 'test_expectations.txt' or basename == 'drt_expectations.txt':
+ if basename == 'TestExpectations':
checker = TestExpectationsChecker(file_path, handle_style_error)
else:
checker = TextChecker(file_path, handle_style_error)
Modified: trunk/Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py (120248 => 120249)
--- trunk/Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py 2012-06-13 21:09:57 UTC (rev 120248)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py 2012-06-13 21:35:31 UTC (rev 120249)
@@ -73,21 +73,6 @@
else:
self.assertEquals(None, expected_port_implementation)
- host = MockHost()
- expectations_path = expectations_path.replace('TestExpectations', 'test_expectations.txt')
- if not expectations_path.startswith('/mock-checkout'):
- expectations_full_path = '/mock-checkout/' + expectations_path
- else:
- expectations_full_path = expectations_path
- host.filesystem.files[expectations_full_path] = 'some content'
-
- checker = TestExpectationsChecker(expectations_path, ErrorCollector(), host=host)
- port = checker._determine_port_from_expectations_path(host, expectations_path)
- if port:
- self.assertTrue(port.name().startswith(expected_port_implementation))
- else:
- self.assertEquals(None, expected_port_implementation)
-
def test_determine_port_from_expectations_path(self):
self._expect_port_for_expectations_path(None, '/')
self._expect_port_for_expectations_path(None, 'LayoutTests/chromium-mac/TestExpectations')
Modified: trunk/Tools/Scripts/webkitpy/tool/steps/commit.py (120248 => 120249)
--- trunk/Tools/Scripts/webkitpy/tool/steps/commit.py 2012-06-13 21:09:57 UTC (rev 120248)
+++ trunk/Tools/Scripts/webkitpy/tool/steps/commit.py 2012-06-13 21:35:31 UTC (rev 120249)
@@ -54,11 +54,7 @@
error.num_local_commits, working_directory_message))
def _check_test_expectations(self, changed_files):
- test_expectations_files = []
- for filename in changed_files:
- if filename.endswith('test_expectations.txt') or filename.endswith('TestExpectations'):
- test_expectations_files.append(filename)
-
+ test_expectations_files = [filename for filename in changed_files if filename.endswith('TestExpectations')]
if not test_expectations_files:
return
Modified: trunk/Tools/Scripts/webkitpy/tool/steps/commit_unittest.py (120248 => 120249)
--- trunk/Tools/Scripts/webkitpy/tool/steps/commit_unittest.py 2012-06-13 21:09:57 UTC (rev 120248)
+++ trunk/Tools/Scripts/webkitpy/tool/steps/commit_unittest.py 2012-06-13 21:35:31 UTC (rev 120249)
@@ -63,6 +63,3 @@
def test_check_test_expectations(self):
self._test_check_test_expectations('TestExpectations')
-
- def test_check_legacy_test_expectations(self):
- self._test_check_test_expectations('test_expectations.txt')