mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
merge run_wpt.py into run.py
This commit is contained in:
parent
4997ec26c2
commit
ae20469636
4 changed files with 13 additions and 31 deletions
|
@ -385,7 +385,7 @@ class MachCommands(CommandBase):
|
||||||
def _test_wpt(self, **kwargs):
|
def _test_wpt(self, **kwargs):
|
||||||
hosts_file_path = path.join(self.context.topdir, 'tests', 'wpt', 'hosts')
|
hosts_file_path = path.join(self.context.topdir, 'tests', 'wpt', 'hosts')
|
||||||
os.environ["hosts_file_path"] = hosts_file_path
|
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)
|
return self.wptrunner(run_file, **kwargs)
|
||||||
|
|
||||||
# Helper to ensure all specified paths are handled, otherwise dispatch to appropriate test suite.
|
# Helper to ensure all specified paths are handled, otherwise dispatch to appropriate test suite.
|
||||||
|
|
|
@ -9,8 +9,7 @@ In particular, this folder contains:
|
||||||
|
|
||||||
* `config.ini`: some configuration for the web-platform-tests.
|
* `config.ini`: some configuration for the web-platform-tests.
|
||||||
* `include.ini`: the subset of web-platform-tests we currently run.
|
* `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`: run the web-platform-tests in Servo.
|
||||||
* `run.py`: common code used by `run_wpt.py`.
|
|
||||||
* `web-platform-tests`: copy of the web-platform-tests.
|
* `web-platform-tests`: copy of the web-platform-tests.
|
||||||
* `metadata`: expected failures for the web-platform-tests we run.
|
* `metadata`: expected failures for the web-platform-tests we run.
|
||||||
* `mozilla`: web-platform-tests that cannot be upstreamed.
|
* `mozilla`: web-platform-tests that cannot be upstreamed.
|
||||||
|
@ -49,7 +48,7 @@ test with `mach test-wpt --release`
|
||||||
Running the tests without mach
|
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
|
directly. However, this requires that all the dependencies for
|
||||||
`wptrunner` are avaliable in the current python environment.
|
`wptrunner` are avaliable in the current python environment.
|
||||||
|
|
||||||
|
|
|
@ -19,15 +19,15 @@ def wpt_path(*args):
|
||||||
def servo_path(*args):
|
def servo_path(*args):
|
||||||
return os.path.join(servo_root, *args)
|
return os.path.join(servo_root, *args)
|
||||||
|
|
||||||
|
paths = {"include_manifest": wpt_path("include.ini"),
|
||||||
|
"config": wpt_path("config.ini")}
|
||||||
# Imports
|
# Imports
|
||||||
sys.path.append(wpt_path("web-platform-tests", "tools", "wptrunner"))
|
sys.path.append(wpt_path("web-platform-tests", "tools", "wptrunner"))
|
||||||
from wptrunner import wptrunner, wptcommandline
|
from wptrunner import wptrunner, wptcommandline
|
||||||
|
|
||||||
|
|
||||||
def run_tests(paths=None, **kwargs):
|
def run_tests(**kwargs):
|
||||||
if paths is None:
|
set_defaults(kwargs)
|
||||||
paths = {}
|
|
||||||
set_defaults(paths, kwargs)
|
|
||||||
|
|
||||||
mozlog.commandline.log_formatters["servo"] = \
|
mozlog.commandline.log_formatters["servo"] = \
|
||||||
(grouping_formatter.GroupingFormatter, "A grouping output formatter")
|
(grouping_formatter.GroupingFormatter, "A grouping output formatter")
|
||||||
|
@ -47,7 +47,7 @@ def run_tests(paths=None, **kwargs):
|
||||||
return 0 if success else 1
|
return 0 if success else 1
|
||||||
|
|
||||||
|
|
||||||
def set_defaults(paths, kwargs):
|
def set_defaults(kwargs):
|
||||||
if kwargs["product"] is None:
|
if kwargs["product"] is None:
|
||||||
kwargs["product"] = "servo"
|
kwargs["product"] = "servo"
|
||||||
|
|
||||||
|
@ -75,7 +75,10 @@ def set_defaults(paths, kwargs):
|
||||||
wptcommandline.check_args(kwargs)
|
wptcommandline.check_args(kwargs)
|
||||||
|
|
||||||
|
|
||||||
def main(paths=None):
|
def main():
|
||||||
parser = wptcommandline.create_parser()
|
parser = wptcommandline.create_parser()
|
||||||
kwargs = vars(parser.parse_args())
|
kwargs = vars(parser.parse_args())
|
||||||
return run_tests(paths, **kwargs)
|
return run_tests(**kwargs)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
sys.exit(0 if main() else 1)
|
||||||
|
|
|
@ -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)
|
|
Loading…
Add table
Add a link
Reference in a new issue