aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2016-09-25 09:13:03 +0200
committerManish Goregaokar <manishsmail@gmail.com>2016-09-28 10:00:36 +0200
commite1e512f86b10c1c093cd28cbc22242a5ded4b283 (patch)
tree8502a80a9902bebdf1de16a7bc4cf6c8e541685e /python/servo
parent28bce69d248995cc6ec83a2b4ada9cf17a888bb5 (diff)
downloadservo-e1e512f86b10c1c093cd28cbc22242a5ded4b283.tar.gz
servo-e1e512f86b10c1c093cd28cbc22242a5ded4b283.zip
Run style unit tests in testing mode, disable some properties in testing mode
Diffstat (limited to 'python/servo')
-rw-r--r--python/servo/testing_commands.py39
1 files changed, 28 insertions, 11 deletions
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py
index 38248f9aae3..3f0a24feb10 100644
--- a/python/servo/testing_commands.py
+++ b/python/servo/testing_commands.py
@@ -210,14 +210,11 @@ class MachCommands(CommandBase):
packages.discard('stylo')
- args = ["cargo", "test"]
- for crate in packages:
- args += ["-p", "%s_tests" % crate]
- args += test_patterns
-
- features = self.servo_features()
- if features:
- args += ["--features", "%s" % ' '.join(features)]
+ has_style = True
+ try:
+ packages.remove('style')
+ except KeyError:
+ has_style = False
env = self.build_env()
env["RUST_BACKTRACE"] = "1"
@@ -230,9 +227,29 @@ class MachCommands(CommandBase):
else:
env["RUSTFLAGS"] = "-C link-args=-Wl,--subsystem,windows"
- result = call(args, env=env, cwd=self.servo_crate())
- if result != 0:
- return result
+ features = self.servo_features()
+ if len(packages) > 0:
+ args = ["cargo", "test"]
+ for crate in packages:
+ args += ["-p", "%s_tests" % crate]
+ args += test_patterns
+
+ if features:
+ args += ["--features", "%s" % ' '.join(features)]
+ result = call(args, env=env, cwd=self.servo_crate())
+ if result != 0:
+ return result
+
+ # Run style tests with the testing feature
+ if has_style:
+ args = ["cargo", "test", "-p", "style_tests", "--features"]
+ if features:
+ args += ["%s" % ' '.join(features + ["testing"])]
+ else:
+ args += ["testing"]
+ result = call(args, env=env, cwd=self.servo_crate())
+ if result != 0:
+ return result
@Command('test-stylo',
description='Run stylo unit tests',