mirror of
https://github.com/servo/servo.git
synced 2025-06-19 22:59:03 +01:00
tests for tidy.py #9152
This commit is contained in:
parent
5cf89fea48
commit
b8c9a288e9
12 changed files with 169 additions and 5 deletions
|
@ -30,6 +30,7 @@ from servo.command_base import CommandBase, call, check_call
|
|||
from wptrunner import wptcommandline
|
||||
from update import updatecommandline
|
||||
import tidy
|
||||
from tidy_self_test import tidy_self_test
|
||||
|
||||
SCRIPT_PATH = os.path.split(__file__)[0]
|
||||
PROJECT_TOPLEVEL_PATH = os.path.abspath(os.path.join(SCRIPT_PATH, "..", ".."))
|
||||
|
@ -71,9 +72,12 @@ class MachCommands(CommandBase):
|
|||
help="Only check changed files and skip the WPT lint in tidy")
|
||||
@CommandArgument('--no-progress', default=False, action="store_true",
|
||||
help="Don't show progress for tidy")
|
||||
def test(self, params, render_mode=DEFAULT_RENDER_MODE, release=False, faster=False, no_progress=False):
|
||||
@CommandArgument('--self-test', default=False, action="store_true",
|
||||
help="Run unit tests for tidy")
|
||||
def test(self, params, render_mode=DEFAULT_RENDER_MODE, release=False, faster=False, no_progress=False,
|
||||
self_test=False):
|
||||
suites = OrderedDict([
|
||||
("tidy", {"kwargs": {"faster": faster, "no_progress": no_progress},
|
||||
("tidy", {"kwargs": {"faster": faster, "no_progress": no_progress, "self_test": self_test},
|
||||
"include_arg": "include"}),
|
||||
("wpt", {"kwargs": {"release": release},
|
||||
"paths": [path.abspath(path.join("tests", "wpt", "web-platform-tests")),
|
||||
|
@ -271,8 +275,13 @@ class MachCommands(CommandBase):
|
|||
"if there are no changes in the WPT files")
|
||||
@CommandArgument('--no-progress', default=False, action="store_true",
|
||||
help="Don't show progress for tidy")
|
||||
def test_tidy(self, faster, no_progress):
|
||||
return tidy.scan(faster, not no_progress)
|
||||
@CommandArgument('--self-test', default=False, action="store_true",
|
||||
help="Run unit tests for tidy")
|
||||
def test_tidy(self, faster, no_progress, self_test):
|
||||
if self_test:
|
||||
return tidy_self_test.do_tests()
|
||||
else:
|
||||
return tidy.scan(faster, not no_progress)
|
||||
|
||||
@Command('test-webidl',
|
||||
description='Run the WebIDL parser tests',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue