mirror of
https://github.com/servo/servo.git
synced 2025-06-09 00:53:26 +00:00
Add unit test crate for stylo
This commit is contained in:
parent
53938c439f
commit
c615a0dabc
5 changed files with 62 additions and 1 deletions
|
@ -25,7 +25,7 @@ from mach.decorators import (
|
|||
Command,
|
||||
)
|
||||
|
||||
from servo.command_base import CommandBase, call, check_call, host_triple
|
||||
from servo.command_base import CommandBase, call, cd, check_call, host_triple
|
||||
from wptrunner import wptcommandline
|
||||
from update import updatecommandline
|
||||
from servo_tidy import tidy
|
||||
|
@ -232,6 +232,26 @@ class MachCommands(CommandBase):
|
|||
if result != 0:
|
||||
return result
|
||||
|
||||
@Command('test-stylo',
|
||||
description='Run stylo unit tests',
|
||||
category='testing')
|
||||
def test_unit(self, test_name=None, package=None):
|
||||
if test_name is None:
|
||||
test_name = []
|
||||
|
||||
self.set_use_stable_rust()
|
||||
self.ensure_bootstrapped()
|
||||
|
||||
env = self.build_env()
|
||||
env["RUST_BACKTRACE"] = "1"
|
||||
env["CARGO_TARGET_DIR"] = path.join(self.context.topdir, "target", "geckolib").encode("UTF-8")
|
||||
|
||||
with cd(path.join("ports", "geckolib")):
|
||||
result = call(["cargo", "test", "-p", "stylo_tests"], env=env)
|
||||
|
||||
if result != 0:
|
||||
return result
|
||||
|
||||
@Command('test-compiletest',
|
||||
description='Run compiletests',
|
||||
category='testing')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue