aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/testing_commands.py
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2016-09-20 20:22:36 +0530
committerManish Goregaokar <manishsmail@gmail.com>2016-09-20 20:26:51 +0530
commitc615a0dabc8828a6c63af83746c428c3d2bb0b7e (patch)
treea50bbcbd50d9f694a69dc6c1e9886e4f0742794d /python/servo/testing_commands.py
parent53938c439f3a0c2b3c3d734346ca291e1eb703a5 (diff)
downloadservo-c615a0dabc8828a6c63af83746c428c3d2bb0b7e.tar.gz
servo-c615a0dabc8828a6c63af83746c428c3d2bb0b7e.zip
Add unit test crate for stylo
Diffstat (limited to 'python/servo/testing_commands.py')
-rw-r--r--python/servo/testing_commands.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py
index 97bf8635190..7e146afc055 100644
--- a/python/servo/testing_commands.py
+++ b/python/servo/testing_commands.py
@@ -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')