diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2015-10-01 16:46:35 +0200 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2015-10-01 17:59:18 +0200 |
commit | 9228b5011dc2fcfb80733f03e2d9420832ff0d59 (patch) | |
tree | b75b02733f4e26f1b95cede14163e39216fe9bc1 /python/servo/testing_commands.py | |
parent | e2048d57c4c0602c5a6b82db8cb76e6c3e5467fa (diff) | |
download | servo-9228b5011dc2fcfb80733f03e2d9420832ff0d59.tar.gz servo-9228b5011dc2fcfb80733f03e2d9420832ff0d59.zip |
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.
Diffstat (limited to 'python/servo/testing_commands.py')
-rw-r--r-- | python/servo/testing_commands.py | 11 |
1 files changed, 6 insertions, 5 deletions
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', |