From 9228b5011dc2fcfb80733f03e2d9420832ff0d59 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Thu, 1 Oct 2015 16:46:35 +0200 Subject: Run all unit tests with just one Cargo command. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- python/servo/testing_commands.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'python/servo/testing_commands.py') diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index e4c36236bd0..e279f1de6b9 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -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', -- cgit v1.2.3