diff options
author | Maciej Skrzypkowski <m.skrzypkows@samsung.com> | 2016-04-07 15:22:37 +0200 |
---|---|---|
committer | Maciej Skrzypkowski <m.skrzypkows@samsung.com> | 2016-04-07 15:22:52 +0200 |
commit | b8c9a288e9cd6dea04082f997fdd0669ddea9b4e (patch) | |
tree | 3750f066b3b6ddd5491993c218671175b5851d29 /python/servo/testing_commands.py | |
parent | 5cf89fea48fb1fc58fd665384cbaa2060decff31 (diff) | |
download | servo-b8c9a288e9cd6dea04082f997fdd0669ddea9b4e.tar.gz servo-b8c9a288e9cd6dea04082f997fdd0669ddea9b4e.zip |
tests for tidy.py #9152
Diffstat (limited to 'python/servo/testing_commands.py')
-rw-r--r-- | python/servo/testing_commands.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index 66785e30abe..ea7cb7e50b8 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -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', |