diff options
-rw-r--r-- | python/servo/testing_commands.py | 29 | ||||
-rw-r--r-- | tests/wpt/config_css.ini | 16 | ||||
-rw-r--r-- | tests/wpt/include_css.ini | 7 | ||||
-rw-r--r-- | tests/wpt/run_css.py | 19 | ||||
-rw-r--r-- | tests/wpt/update_css.py | 40 |
5 files changed, 110 insertions, 1 deletions
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index 46efd4d5450..c2154859dde 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -93,7 +93,7 @@ class MachCommands(CommandBase): return self.infer_test_by_dir(params) test_start = time() - for t in ["tidy", "ref", "content", "wpt", "unit"]: + for t in ["tidy", "ref", "content", "wpt", "css", "unit"]: Registrar.dispatch("test-%s" % t, context=self.context) elapsed = time() - test_start @@ -245,6 +245,33 @@ class MachCommands(CommandBase): execfile(run_file, run_globals) return run_globals["update_tests"](**kwargs) + @Command('test-css', + description='Run the web platform tests', + category='testing', + parser=wptcommandline.create_parser()) + @CommandArgument('--release', default=False, action="store_true", + help="Run with a release build of servo") + def test_css(self, **kwargs): + self.ensure_bootstrapped() + self.ensure_wpt_virtualenv() + + run_file = path.abspath(path.join("tests", "wpt", "run_css.py")) + run_globals = {"__file__": run_file} + execfile(run_file, run_globals) + return run_globals["run_tests"](**kwargs) + + @Command('update-css', + description='Update the web platform tests', + category='testing', + parser=updatecommandline.create_parser()) + def update_css(self, **kwargs): + self.ensure_bootstrapped() + self.ensure_wpt_virtualenv() + run_file = path.abspath(path.join("tests", "wpt", "update_css.py")) + run_globals = {"__file__": run_file} + execfile(run_file, run_globals) + return run_globals["update_tests"](**kwargs) + def ensure_wpt_virtualenv(self): virtualenv_path = path.join("tests", "wpt", "_virtualenv") diff --git a/tests/wpt/config_css.ini b/tests/wpt/config_css.ini new file mode 100644 index 00000000000..14158a31a2d --- /dev/null +++ b/tests/wpt/config_css.ini @@ -0,0 +1,16 @@ +[products] +servo = + +[web-platform-tests] +name = CSS tests +remote_url = https://github.com/jgraham/css-test-built +branch = master +sync_path = sync_css + +[paths] +run-info = . + +[manifest:upstream] +tests = css-tests +metadata = metadata-css +url-base = / diff --git a/tests/wpt/include_css.ini b/tests/wpt/include_css.ini new file mode 100644 index 00000000000..58e9fe941a1 --- /dev/null +++ b/tests/wpt/include_css.ini @@ -0,0 +1,7 @@ +skip: true +[css21_dev] + skip: false + [xhtml1] + skip: true + [xhtml1print] + skip: true
\ No newline at end of file diff --git a/tests/wpt/run_css.py b/tests/wpt/run_css.py new file mode 100644 index 00000000000..08d4d80bbc5 --- /dev/null +++ b/tests/wpt/run_css.py @@ -0,0 +1,19 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#!/usr/bin/env python + +import run + +paths = {"include_manifest": run.wpt_path("include_css.ini"), + "config": run.wpt_path("config_css.ini")} + +def run_tests(**kwargs): + return run.run_tests(paths=paths, **kwargs) + +def main(): + return run.main(paths) + +if __name__ == "__main__": + sys.exit(0 if main() else 1) diff --git a/tests/wpt/update_css.py b/tests/wpt/update_css.py new file mode 100644 index 00000000000..75fffd9cb4d --- /dev/null +++ b/tests/wpt/update_css.py @@ -0,0 +1,40 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#!/usr/bin/env python + +import argparse +import os +import sys + +here = os.path.split(__file__)[0] + +def wpt_path(*args): + return os.path.join(here, *args) + +# Imports +sys.path.append(wpt_path("harness")) +from wptrunner import wptcommandline + +def update_tests(**kwargs): + from wptrunner import update + + set_defaults(kwargs) + logger = update.setup_logging(kwargs, {"mach": sys.stdout}) + + rv = update.run_update(logger, **kwargs) + return 0 if rv is update.update.exit_clean else 1 + +def set_defaults(kwargs): + if kwargs["config"] is None: + kwargs["config"] = wpt_path('config_css.ini') + wptcommandline.set_from_config(kwargs) + +def main(): + parser = wptcommandline.create_parser_update() + kwargs = vars(parser.parse_args()) + return update_tests(**kwargs) + +if __name__ == "__main__": + sys.exit(0 if main() else 1) |