aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/testing_commands.py
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-09-28 16:39:49 -0500
committerGitHub <noreply@github.com>2016-09-28 16:39:49 -0500
commit13c4393516df0d3415ed28d107f3744d56b59623 (patch)
tree66caa0c1091788161ed69928e521d5a402802b3e /python/servo/testing_commands.py
parent0ee35a3b34a8b314ec2503354c385f5d58d70518 (diff)
parente1e512f86b10c1c093cd28cbc22242a5ded4b283 (diff)
downloadservo-13c4393516df0d3415ed28d107f3744d56b59623.tar.gz
servo-13c4393516df0d3415ed28d107f3744d56b59623.zip
Auto merge of #13415 - Manishearth:style-testing-disable, r=SimonSapin
Run style unit tests in testing mode, disable some properties in testing mode Another crack at making it possible to test geckolib properties. In the previous PR I added support for a testing mode but neglected to use it in the style unit tests. Using it brought out some bugs with properties that exist in both gecko and servo but have different names. Added the ability to disable them. Hopefully this isn't too unweildy. r? @emilio <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13415) <!-- Reviewable:end -->
Diffstat (limited to 'python/servo/testing_commands.py')
-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 fba90a17994..f990fbf9ec2 100644
--- a/python/servo/testing_commands.py
+++ b/python/servo/testing_commands.py
@@ -220,14 +220,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"
@@ -240,9 +237,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',