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 -->
This commit is contained in:
bors-servo 2016-09-28 16:39:49 -05:00 committed by GitHub
commit 13c4393516
6 changed files with 39 additions and 18 deletions

View file

@ -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',