mirror of
https://github.com/servo/servo.git
synced 2025-06-13 10:54:29 +00:00
Factor out common code for mach test-wpt/test-css
This commit is contained in:
parent
6f55e949a1
commit
d11a70f53a
1 changed files with 7 additions and 10 deletions
|
@ -332,19 +332,19 @@ class MachCommands(CommandBase):
|
||||||
@Command('test-wpt',
|
@Command('test-wpt',
|
||||||
description='Run the web platform tests',
|
description='Run the web platform tests',
|
||||||
category='testing',
|
category='testing',
|
||||||
parser=wptcommandline.create_parser)
|
parser=create_parser_wpt)
|
||||||
@CommandArgument('--release', default=False, action="store_true",
|
|
||||||
help="Run with a release build of servo")
|
|
||||||
def test_wpt(self, **kwargs):
|
def test_wpt(self, **kwargs):
|
||||||
self.ensure_bootstrapped()
|
self.ensure_bootstrapped()
|
||||||
hosts_file_path = path.join(self.context.topdir, 'tests', 'wpt', 'hosts')
|
hosts_file_path = path.join(self.context.topdir, 'tests', 'wpt', 'hosts')
|
||||||
|
|
||||||
os.environ["hosts_file_path"] = hosts_file_path
|
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"]
|
kwargs["debug"] = not kwargs["release"]
|
||||||
|
|
||||||
run_file = path.abspath(path.join(self.context.topdir, "tests", "wpt", "run_wpt.py"))
|
|
||||||
run_globals = {"__file__": run_file}
|
run_globals = {"__file__": run_file}
|
||||||
execfile(run_file, run_globals)
|
execfile(run_file, run_globals)
|
||||||
return run_globals["run_tests"](**kwargs)
|
return run_globals["run_tests"](**kwargs)
|
||||||
|
@ -398,11 +398,8 @@ class MachCommands(CommandBase):
|
||||||
parser=create_parser_wpt)
|
parser=create_parser_wpt)
|
||||||
def test_css(self, **kwargs):
|
def test_css(self, **kwargs):
|
||||||
self.ensure_bootstrapped()
|
self.ensure_bootstrapped()
|
||||||
|
|
||||||
run_file = path.abspath(path.join("tests", "wpt", "run_css.py"))
|
run_file = path.abspath(path.join("tests", "wpt", "run_css.py"))
|
||||||
run_globals = {"__file__": run_file}
|
return self.wptrunner(run_file, **kwargs)
|
||||||
execfile(run_file, run_globals)
|
|
||||||
return run_globals["run_tests"](**kwargs)
|
|
||||||
|
|
||||||
@Command('update-css',
|
@Command('update-css',
|
||||||
description='Update the web platform tests',
|
description='Update the web platform tests',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue