diff options
author | Shing Lyu <shing.lyu@gmail.com> | 2016-01-29 17:32:39 +0800 |
---|---|---|
committer | Shing Lyu <shing.lyu@gmail.com> | 2016-01-29 21:12:21 +0800 |
commit | 18b6817755b3509990e0a9fbe1acb5318d81c957 (patch) | |
tree | f55fc21d3188f4890532401d0c5d680d08a1c68f /python/servo/testing_commands.py | |
parent | 1483a5de32511f4f8e4868e8ae55ef6e8406f0f6 (diff) | |
download | servo-18b6817755b3509990e0a9fbe1acb5318d81c957.tar.gz servo-18b6817755b3509990e0a9fbe1acb5318d81c957.zip |
Add mach test-webidl command
Diffstat (limited to 'python/servo/testing_commands.py')
-rw-r--r-- | python/servo/testing_commands.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index bad1694579c..100414a68e2 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -232,6 +232,26 @@ class MachCommands(CommandBase): def test_tidy(self, faster): return tidy.scan(faster) + @Command('test-webidl', + description='Run the WebIDL parser tests', + category='testing') + @CommandArgument('--quiet', '-q', default=False, action="store_true", + help="Don't print passing tests.") + @CommandArgument('tests', default=None, nargs="...", + help="Specific tests to run, relative to the tests directory") + def test_webidl(self, quiet, tests): + self.ensure_bootstrapped() + + test_file_dir = path.abspath(path.join(PROJECT_TOPLEVEL_PATH, "components", "script", "dom", "bindings", "codegen", "parser")) + sys.path.insert(0, test_file_dir) # For the `import WebIDL` in runtests.py + + run_file = path.abspath(path.join(test_file_dir, "runtests.py")) + run_globals = {"__file__": run_file} + execfile(run_file, run_globals) + + verbose = not quiet + return run_globals["run_tests"](tests, verbose) + @Command('test-wpt-failure', description='Run the web platform tests', category='testing') |