[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da
philn at webkit.org
philn at webkit.org
Wed Dec 22 18:36:53 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 0e577ed00158b3f9cd79ccf4ca4892b3665b4ba5
Author: philn at webkit.org <philn at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Dec 14 17:54:09 2010 +0000
2010-12-14 Philippe Normand <pnormand at igalia.com>
Reviewed by Ojan Vafai.
[new-run-webkit-tests] expectations parsing is slow
https://bugs.webkit.org/show_bug.cgi?id=50635
Avoid expensive iteration of all the tests when checking if a test
file is to be skipped or not.
* Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
* Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py:
* Scripts/webkitpy/layout_tests/port/test.py:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index b4d3288..3ac6c66 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,17 @@
+2010-12-14 Philippe Normand <pnormand at igalia.com>
+
+ Reviewed by Ojan Vafai.
+
+ [new-run-webkit-tests] expectations parsing is slow
+ https://bugs.webkit.org/show_bug.cgi?id=50635
+
+ Avoid expensive iteration of all the tests when checking if a test
+ file is to be skipped or not.
+
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/test.py:
+
2010-12-14 Mario Sanchez Prada <msanchez at igalia.com>
Reviewed by Xan Lopez.
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py
index 7e1e53a..a237863 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py
@@ -727,15 +727,25 @@ class TestExpectationsFile:
def _expand_tests(self, test_list_path):
"""Convert the test specification to an absolute, normalized
path and make sure directories end with the OS path separator."""
+ # FIXME: full_test_list can quickly contain a big amount of
+ # elements. We should consider at some point to use a more
+ # efficient structure instead of a list. Maybe a dictionary of
+ # lists to represent the tree of tests, leaves being test
+ # files and nodes being categories.
+
path = os.path.join(self._port.layout_tests_dir(), test_list_path)
path = os.path.normpath(path)
if self._port.path_isdir(path):
+ # this is a test category, return all the tests of the category.
path = os.path.join(path, '')
+ return [test for test in self._full_test_list if test.startswith(path)]
+
+ # this is a test file, do a quick check if it's in the
+ # full test suite.
result = []
- for test in self._full_test_list:
- if test.startswith(path):
- result.append(test)
+ if path in self._full_test_list:
+ result = [path, ]
return result
def _add_tests(self, tests, expectations, test_list_path, lineno,
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py
index e04ac31..34771f3 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py
@@ -145,6 +145,20 @@ BUGX WONTFIX : failures/expected = IMAGE
self.assert_exp('failures/expected/text.html', TEXT)
self.assert_exp('failures/expected/crash.html', IMAGE)
+ def test_category_expectations(self):
+ # This test checks unknown tests are not present in the
+ # expectations and that known test part of a test category is
+ # present in the expectations.
+ exp_str = """
+BUGX WONTFIX : failures/expected = IMAGE
+"""
+ self.parse_exp(exp_str)
+ test_name = 'failures/expected/unknown-test.html'
+ unknown_test = self.get_test(test_name)
+ self.assertRaises(KeyError, self._exp.get_expectations,
+ unknown_test)
+ self.assert_exp('failures/expected/crash.html', IMAGE)
+
def test_release_mode(self):
self.parse_exp('BUGX DEBUG : failures/expected/text.html = TEXT',
is_debug_mode=True)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py
index 8e27f35..9e79667 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py
@@ -205,10 +205,25 @@ class TestPort(base.Port):
def path_isdir(self, path):
# Used by test_expectations.py
#
- # We assume that a path is a directory if we have any tests that
- # whose prefix matches the path plus a directory modifier.
+ # We assume that a path is a directory if we have any tests
+ # that whose prefix matches the path plus a directory modifier
+ # and not a file extension.
if path[-1] != '/':
path += '/'
+
+ # FIXME: Directories can have a dot in the name. We should
+ # probably maintain a white list of known cases like CSS2.1
+ # and check it here in the future.
+ if path.find('.') != -1:
+ # extension separator found, assume this is a file
+ return False
+
+ # strip out layout tests directory path if found. The tests
+ # keys are relative to it.
+ tests_dir = self.layout_tests_dir()
+ if path.startswith(tests_dir):
+ path = path[len(tests_dir) + 1:]
+
return any([t.startswith(path) for t in self._tests.keys()])
def test_dirs(self):
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list