diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index b0ef2cfa5ce..db369a82b2d 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -385,7 +385,7 @@ class MachCommands(CommandBase): def _test_wpt(self, **kwargs): hosts_file_path = path.join(self.context.topdir, 'tests', 'wpt', 'hosts') os.environ["hosts_file_path"] = hosts_file_path - run_file = path.abspath(path.join(self.context.topdir, "tests", "wpt", "run_wpt.py")) + run_file = path.abspath(path.join(self.context.topdir, "tests", "wpt", "run.py")) return self.wptrunner(run_file, **kwargs) # Helper to ensure all specified paths are handled, otherwise dispatch to appropriate test suite. diff --git a/tests/wpt/README.md b/tests/wpt/README.md index b8fd1d7c886..26c9639d627 100644 --- a/tests/wpt/README.md +++ b/tests/wpt/README.md @@ -9,8 +9,7 @@ In particular, this folder contains: * `config.ini`: some configuration for the web-platform-tests. * `include.ini`: the subset of web-platform-tests we currently run. -* `run_wpt.py`: glue code to run the web-platform-tests in Servo. -* `run.py`: common code used by `run_wpt.py`. +* `run.py`: run the web-platform-tests in Servo. * `web-platform-tests`: copy of the web-platform-tests. * `metadata`: expected failures for the web-platform-tests we run. * `mozilla`: web-platform-tests that cannot be upstreamed. @@ -49,7 +48,7 @@ test with `mach test-wpt --release` Running the tests without mach ------------------------------ -When avoiding `mach` for some reason, one can run `run_wpt.py` +When avoiding `mach` for some reason, one can run `run.py` directly. However, this requires that all the dependencies for `wptrunner` are avaliable in the current python environment. diff --git a/tests/wpt/run.py b/tests/wpt/run.py index 46b5b1fab6f..e77494ae46e 100644 --- a/tests/wpt/run.py +++ b/tests/wpt/run.py @@ -19,15 +19,15 @@ def wpt_path(*args): def servo_path(*args): return os.path.join(servo_root, *args) +paths = {"include_manifest": wpt_path("include.ini"), + "config": wpt_path("config.ini")} # Imports sys.path.append(wpt_path("web-platform-tests", "tools", "wptrunner")) from wptrunner import wptrunner, wptcommandline -def run_tests(paths=None, **kwargs): - if paths is None: - paths = {} - set_defaults(paths, kwargs) +def run_tests(**kwargs): + set_defaults(kwargs) mozlog.commandline.log_formatters["servo"] = \ (grouping_formatter.GroupingFormatter, "A grouping output formatter") @@ -47,7 +47,7 @@ def run_tests(paths=None, **kwargs): return 0 if success else 1 -def set_defaults(paths, kwargs): +def set_defaults(kwargs): if kwargs["product"] is None: kwargs["product"] = "servo" @@ -75,7 +75,10 @@ def set_defaults(paths, kwargs): wptcommandline.check_args(kwargs) -def main(paths=None): +def main(): parser = wptcommandline.create_parser() kwargs = vars(parser.parse_args()) - return run_tests(paths, **kwargs) + return run_tests(**kwargs) + +if __name__ == "__main__": + sys.exit(0 if main() else 1) diff --git a/tests/wpt/run_wpt.py b/tests/wpt/run_wpt.py deleted file mode 100644 index 676c5fb426d..00000000000 --- a/tests/wpt/run_wpt.py +++ /dev/null @@ -1,20 +0,0 @@ -# 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/. - -import run -import sys - -paths = {"include_manifest": run.wpt_path("include.ini"), - "config": run.wpt_path("config.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)