diff options
author | Matt Brubeck <mbrubeck@limpet.net> | 2016-02-11 09:52:25 -0800 |
---|---|---|
committer | Matt Brubeck <mbrubeck@limpet.net> | 2016-02-11 10:01:05 -0800 |
commit | d11a70f53a647bcea3f56ae36b064d4a25b60090 (patch) | |
tree | fd5ef4888c9df2eb3ae3ab170bf8a61f57ca0ca4 /python/servo/testing_commands.py | |
parent | 6f55e949a1b272389f45811c59603c6c3076107a (diff) | |
download | servo-d11a70f53a647bcea3f56ae36b064d4a25b60090.tar.gz servo-d11a70f53a647bcea3f56ae36b064d4a25b60090.zip |
Factor out common code for mach test-wpt/test-css
Diffstat (limited to 'python/servo/testing_commands.py')
-rw-r--r-- | python/servo/testing_commands.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index d9d26366d20..bd2b61cc21a 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -332,19 +332,19 @@ class MachCommands(CommandBase): @Command('test-wpt', description='Run the web platform tests', category='testing', - parser=wptcommandline.create_parser) - @CommandArgument('--release', default=False, action="store_true", - help="Run with a release build of servo") + parser=create_parser_wpt) def test_wpt(self, **kwargs): self.ensure_bootstrapped() hosts_file_path = path.join(self.context.topdir, 'tests', 'wpt', 'hosts') - os.environ["hosts_file_path"] = hosts_file_path - os.environ["RUST_BACKTRACE"] = "1" + run_file = path.abspath(path.join(self.context.topdir, "tests", "wpt", "run_wpt.py")) + return self.wptrunner(run_file, **kwargs) + # Helper for test_css and test_wpt: + def wptrunner(self, run_file, **kwargs): + os.environ["RUST_BACKTRACE"] = "1" kwargs["debug"] = not kwargs["release"] - run_file = path.abspath(path.join(self.context.topdir, "tests", "wpt", "run_wpt.py")) run_globals = {"__file__": run_file} execfile(run_file, run_globals) return run_globals["run_tests"](**kwargs) @@ -398,11 +398,8 @@ class MachCommands(CommandBase): parser=create_parser_wpt) def test_css(self, **kwargs): self.ensure_bootstrapped() - run_file = path.abspath(path.join("tests", "wpt", "run_css.py")) - run_globals = {"__file__": run_file} - execfile(run_file, run_globals) - return run_globals["run_tests"](**kwargs) + return self.wptrunner(run_file, **kwargs) @Command('update-css', description='Update the web platform tests', |