From d42a00db6080aa2c0798fc9ce150d0d74672e8e4 Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Fri, 20 Oct 2017 08:34:27 +1000 Subject: [PATCH] Add iterpath and iterdir to CSS test runner. This allows running a subset of the CSS tests again, by specifying a directory or single test. Fixes #18931. --- tests/wpt/css-tests/tools/manifest/manifest.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/wpt/css-tests/tools/manifest/manifest.py b/tests/wpt/css-tests/tools/manifest/manifest.py index 7c012734e4f..8bbabc38a44 100644 --- a/tests/wpt/css-tests/tools/manifest/manifest.py +++ b/tests/wpt/css-tests/tools/manifest/manifest.py @@ -46,6 +46,20 @@ class Manifest(object): for path, tests in sorted(iteritems(self._data[item_type])): yield item_type, path, tests + def iterpath(self, path): + for type_tests in self._data.values(): + for test in type_tests.get(path, set()): + yield test + + def iterdir(self, dir_name): + if not dir_name.endswith(os.path.sep): + dir_name = dir_name + os.path.sep + for type_tests in self._data.values(): + for path, tests in type_tests.iteritems(): + if path.startswith(dir_name): + for test in tests: + yield test + @property def reftest_nodes_by_url(self): if self._reftest_nodes_by_url is None: