merge run_wpt.py into run.py

This commit is contained in:
ergunsh 2018-07-22 22:59:59 +03:00
parent 4997ec26c2
commit ae20469636
4 changed files with 13 additions and 31 deletions

View file

@ -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.

View file

@ -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.

View file

@ -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)

View file

@ -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)