mirror of
https://github.com/servo/servo.git
synced 2025-07-21 14:23:41 +01:00
Auto merge of #11570 - talklittle:mach_test_9544, r=Manishearth
mach: Introduce --all flag to run all test suites <!-- Please describe your changes on the following line: --> Add `--all` argument to get `./mach test --all` for running all test suites. Remove broken `faster` argument passed to `test_tidy()` when running `./mach test`. --- <!-- 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 #9544 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because fixing `mach test` <!-- 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="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11570) <!-- Reviewable:end -->
This commit is contained in:
commit
fd03e02291
1 changed files with 16 additions and 7 deletions
|
@ -58,7 +58,7 @@ class MachCommands(CommandBase):
|
||||||
self.context.built_tests = False
|
self.context.built_tests = False
|
||||||
|
|
||||||
@Command('test',
|
@Command('test',
|
||||||
description='Run all Servo tests',
|
description='Run specified Servo tests',
|
||||||
category='testing')
|
category='testing')
|
||||||
@CommandArgument('params', default=None, nargs="...",
|
@CommandArgument('params', default=None, nargs="...",
|
||||||
help="Optionally select test based on "
|
help="Optionally select test based on "
|
||||||
|
@ -68,16 +68,19 @@ class MachCommands(CommandBase):
|
||||||
HELP_RENDER_MODE)
|
HELP_RENDER_MODE)
|
||||||
@CommandArgument('--release', default=False, action="store_true",
|
@CommandArgument('--release', default=False, action="store_true",
|
||||||
help="Run with a release build of servo")
|
help="Run with a release build of servo")
|
||||||
@CommandArgument('--faster', default=False, action="store_true",
|
@CommandArgument('--tidy-all', default=False, action="store_true",
|
||||||
help="Only check changed files and skip the WPT lint in tidy")
|
help="Check all files, and run the WPT lint in tidy, "
|
||||||
|
"even if unchanged")
|
||||||
@CommandArgument('--no-progress', default=False, action="store_true",
|
@CommandArgument('--no-progress', default=False, action="store_true",
|
||||||
help="Don't show progress for tidy")
|
help="Don't show progress for tidy")
|
||||||
@CommandArgument('--self-test', default=False, action="store_true",
|
@CommandArgument('--self-test', default=False, action="store_true",
|
||||||
help="Run unit tests for tidy")
|
help="Run unit tests for tidy")
|
||||||
def test(self, params, render_mode=DEFAULT_RENDER_MODE, release=False, faster=False, no_progress=False,
|
@CommandArgument('--all', default=False, action="store_true", dest="all_suites",
|
||||||
self_test=False):
|
help="Run all test suites")
|
||||||
|
def test(self, params, render_mode=DEFAULT_RENDER_MODE, release=False, tidy_all=False,
|
||||||
|
no_progress=False, self_test=False, all_suites=False):
|
||||||
suites = OrderedDict([
|
suites = OrderedDict([
|
||||||
("tidy", {"kwargs": {"faster": faster, "no_progress": no_progress, "self_test": self_test},
|
("tidy", {"kwargs": {"all_files": tidy_all, "no_progress": no_progress, "self_test": self_test},
|
||||||
"include_arg": "include"}),
|
"include_arg": "include"}),
|
||||||
("wpt", {"kwargs": {"release": release},
|
("wpt", {"kwargs": {"release": release},
|
||||||
"paths": [path.abspath(path.join("tests", "wpt", "web-platform-tests")),
|
"paths": [path.abspath(path.join("tests", "wpt", "web-platform-tests")),
|
||||||
|
@ -99,7 +102,13 @@ class MachCommands(CommandBase):
|
||||||
selected_suites = OrderedDict()
|
selected_suites = OrderedDict()
|
||||||
|
|
||||||
if params is None:
|
if params is None:
|
||||||
|
if all_suites:
|
||||||
params = suites.keys()
|
params = suites.keys()
|
||||||
|
else:
|
||||||
|
print("Specify a test path or suite name, or pass --all to run all test suites.\n\nAvailable suites:")
|
||||||
|
for s in suites:
|
||||||
|
print(" %s" % s)
|
||||||
|
return 1
|
||||||
|
|
||||||
for arg in params:
|
for arg in params:
|
||||||
found = False
|
found = False
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue