Auto merge of #7813 - servo:parallel-unit-tests, r=mbrubeck

Run all unit tests with just one Cargo command.

Upgrade Cargo to get https://github.com/rust-lang/cargo/pull/1828, and use it for unit tests. This allows Cargo to get some more parallelism when compiling the test crates’ dependencies.

`touch components/util/lib.rs && mach test-unit` on my machine goes from 149 seconds to 124.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7813)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-10-01 12:39:10 -06:00
commit ba2714f4f6
2 changed files with 7 additions and 6 deletions

View file

@ -175,12 +175,13 @@ class MachCommands(CommandBase):
if not packages:
packages = set(os.listdir(path.join(self.context.topdir, "tests", "unit")))
args = ["cargo", "test"]
for crate in packages:
result = subprocess.call(
["cargo", "test", "-p", "%s_tests" % crate] + test_patterns,
env=self.build_env(), cwd=self.servo_crate())
if result != 0:
return result
args += ["-p", "%s_tests" % crate]
args += test_patterns
result = subprocess.call(args, env=self.build_env(), cwd=self.servo_crate())
if result != 0:
return result
@Command('test-ref',
description='Run the reference tests',