Commit 81d631ba authored by rniwa@webkit.org's avatar 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):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105644 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3d93ef60
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.
......@@ -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 []
......
......@@ -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'
......
......@@ -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()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment