run-perf-tests ignore Skipped list on chromium
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Jan 2012 22:42:09 +0000 (22:42 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Jan 2012 22:42:09 +0000 (22:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=76764

Reviewed by Dirk Pranke.

Move skipped_perf_tests from WebKit port to Base port so that Chromium port
can also find skipped list. Chromium port only uses test_expectations.txt for
layout tests but performacne tests don't use test_expectations.txt so Chromium port
also needs to use Skipped list.

* Scripts/webkitpy/layout_tests/port/base.py:
(Port._tests_from_skipped_file_contents):
(Port):
(Port._expectations_from_skipped_files):
(Port.skipped_perf_tests):
* Scripts/webkitpy/layout_tests/port/base_unittest.py:
(PortTest.test_skipped_perf_tests):
(PortTest.test_skipped_perf_tests.add_text_file):
* Scripts/webkitpy/layout_tests/port/webkit.py:
(WebKitPort._skipped_tests_for_unsupported_features):
(WebKitPort._skipped_file_search_paths):
(WebKitPort.skipped_layout_tests):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@105644 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/layout_tests/port/base.py
Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py
Tools/Scripts/webkitpy/layout_tests/port/webkit.py

index 6691274586eca483818eb3b2dcf70c6ac0cba0ae..a6c0241a4cbf0060f2d80c59928196179a45d18d 100644 (file)
@@ -1,3 +1,28 @@
+2012-01-22  Ryosuke Niwa  <rniwa@webkit.org>
+
+        run-perf-tests ignore Skipped list on chromium
+        https://bugs.webkit.org/show_bug.cgi?id=76764
+
+        Reviewed by Dirk Pranke.
+
+        Move skipped_perf_tests from WebKit port to Base port so that Chromium port
+        can also find skipped list. Chromium port only uses test_expectations.txt for
+        layout tests but performacne tests don't use test_expectations.txt so Chromium port
+        also needs to use Skipped list.
+
+        * Scripts/webkitpy/layout_tests/port/base.py:
+        (Port._tests_from_skipped_file_contents):
+        (Port):
+        (Port._expectations_from_skipped_files):
+        (Port.skipped_perf_tests):
+        * Scripts/webkitpy/layout_tests/port/base_unittest.py:
+        (PortTest.test_skipped_perf_tests):
+        (PortTest.test_skipped_perf_tests.add_text_file):
+        * Scripts/webkitpy/layout_tests/port/webkit.py:
+        (WebKitPort._skipped_tests_for_unsupported_features):
+        (WebKitPort._skipped_file_search_paths):
+        (WebKitPort.skipped_layout_tests):
+
 2012-01-23  Andy Estes  <aestes@apple.com>
 
         Fix the build after r105635.
index 753e6ee5c33428df11507d0eaf10bda7e5596263..ea86ec6f613b2936f251d97f06f316cb97ee9965 100755 (executable)
@@ -574,8 +574,31 @@ class Port(object):
     def skipped_layout_tests(self):
         return []
 
+    def _tests_from_skipped_file_contents(self, skipped_file_contents):
+        tests_to_skip = []
+        for line in skipped_file_contents.split('\n'):
+            line = line.strip()
+            line = line.rstrip('/')  # Best to normalize directory names to not include the trailing slash.
+            if line.startswith('#') or not len(line):
+                continue
+            tests_to_skip.append(line)
+        return tests_to_skip
+
+    def _expectations_from_skipped_files(self, skipped_file_paths):
+        tests_to_skip = []
+        for search_path in skipped_file_paths:
+            filename = self._filesystem.join(self._webkit_baseline_path(search_path), "Skipped")
+            if not self._filesystem.exists(filename):
+                _log.debug("Skipped does not exist: %s" % filename)
+                continue
+            _log.debug("Using Skipped file: %s" % filename)
+            skipped_file_contents = self._filesystem.read_text_file(filename)
+            tests_to_skip.extend(self._tests_from_skipped_file_contents(skipped_file_contents))
+        return tests_to_skip
+
+    @memoized
     def skipped_perf_tests(self):
-        return []
+        return self._expectations_from_skipped_files([self.perf_tests_dir()])
 
     def skipped_tests(self):
         return []
index 18d9b9df7178cde364f01217b505f9968dc038b2..f981ac2cbd925543bd5b4ad8d54764e68be66bf9 100644 (file)
@@ -230,6 +230,22 @@ class PortTest(unittest.TestCase):
         self.assertTrue('canvas' in dirs)
         self.assertTrue('css2.1' in dirs)
 
+    def test_skipped_perf_tests(self):
+        port = self.make_port()
+
+        def add_text_file(dirname, filename, content='some content'):
+            dirname = port.host.filesystem.join(port.perf_tests_dir(), dirname)
+            port.host.filesystem.maybe_make_directory(dirname)
+            port.host.filesystem.write_text_file(port.host.filesystem.join(dirname, filename), content)
+
+        add_text_file('inspector', 'test1.html')
+        add_text_file('inspector', 'unsupported_test1.html')
+        add_text_file('inspector', 'test2.html')
+        add_text_file('inspector/resources', 'resource_file.html')
+        add_text_file('unsupported', 'unsupported_test2.html')
+        add_text_file('', 'Skipped', '\n'.join(['Layout', '', 'SunSpider', 'Supported/some-test.html']))
+        self.assertEqual(port.skipped_perf_tests(), ['Layout', 'SunSpider', 'Supported/some-test.html'])
+
     def test_get_option__set(self):
         options, args = optparse.OptionParser().parse_args([])
         options.foo = 'bar'
index cbac69e0ba9b87545ec1d5508daf99ebd1385b82..0c35f49e9fcf5dc23e9e267580f8796fd2462a11 100644 (file)
@@ -322,16 +322,6 @@ class WebKitPort(Port):
         # Failed to get any runtime or symbol information, don't skip any tests.
         return []
 
-    def _tests_from_skipped_file_contents(self, skipped_file_contents):
-        tests_to_skip = []
-        for line in skipped_file_contents.split('\n'):
-            line = line.strip()
-            line = line.rstrip('/')  # Best to normalize directory names to not include the trailing slash.
-            if line.startswith('#') or not len(line):
-                continue
-            tests_to_skip.append(line)
-        return tests_to_skip
-
     def _wk2_port_name(self):
         # By current convention, the WebKit2 name is always mac-wk2, win-wk2, not mac-leopard-wk2, etc.
         return "%s-wk2" % self.port_name
@@ -351,18 +341,6 @@ class WebKitPort(Port):
             search_paths.update([self._wk2_port_name(), "wk2"])
         return search_paths
 
-    def _expectations_from_skipped_files(self, skipped_file_paths):
-        tests_to_skip = []
-        for search_path in skipped_file_paths:
-            filename = self._filesystem.join(self._webkit_baseline_path(search_path), "Skipped")
-            if not self._filesystem.exists(filename):
-                _log.debug("Skipped does not exist: %s" % filename)
-                continue
-            _log.debug("Using Skipped file: %s" % filename)
-            skipped_file_contents = self._filesystem.read_text_file(filename)
-            tests_to_skip.extend(self._tests_from_skipped_file_contents(skipped_file_contents))
-        return tests_to_skip
-
     def test_expectations(self):
         # This allows ports to use a combination of test_expectations.txt files and Skipped lists.
         expectations = ''
@@ -380,10 +358,6 @@ class WebKitPort(Port):
         tests_to_skip.update(self._skipped_tests_for_unsupported_features())
         return tests_to_skip
 
-    @memoized
-    def skipped_perf_tests(self):
-        return self._expectations_from_skipped_files([self.perf_tests_dir()])
-
     def skipped_tests(self):
         return self.skipped_layout_tests()