mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #21229 - ergunsh:merge-run-wpt, r=jdm
Merge run_wpt.py into run.py <!-- Please describe your changes on the following line: --> To ensure everything is still works, one can run `./mach test-wpt tests/wpt/mozilla/DOMParser.html` --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #21201 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21229) <!-- Reviewable:end -->
This commit is contained in:
commit
8933a06eb8
4 changed files with 13 additions and 31 deletions
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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