mirror of
https://github.com/servo/servo.git
synced 2025-06-21 07:38:59 +01:00
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:
commit
ba2714f4f6
2 changed files with 7 additions and 6 deletions
|
@ -1 +1 @@
|
||||||
2015-08-20
|
2015-10-01
|
||||||
|
|
|
@ -175,10 +175,11 @@ class MachCommands(CommandBase):
|
||||||
if not packages:
|
if not packages:
|
||||||
packages = set(os.listdir(path.join(self.context.topdir, "tests", "unit")))
|
packages = set(os.listdir(path.join(self.context.topdir, "tests", "unit")))
|
||||||
|
|
||||||
|
args = ["cargo", "test"]
|
||||||
for crate in packages:
|
for crate in packages:
|
||||||
result = subprocess.call(
|
args += ["-p", "%s_tests" % crate]
|
||||||
["cargo", "test", "-p", "%s_tests" % crate] + test_patterns,
|
args += test_patterns
|
||||||
env=self.build_env(), cwd=self.servo_crate())
|
result = subprocess.call(args, env=self.build_env(), cwd=self.servo_crate())
|
||||||
if result != 0:
|
if result != 0:
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue