Add support for --test-args to cargotest

This allows running a single test without having to wait for all tests
to complete.
This commit is contained in:
Joshua Nelson 2021-05-01 01:11:44 -04:00
parent b52769b804
commit d95a6cf911
2 changed files with 4 additions and 1 deletions

View file

@ -183,6 +183,7 @@ impl Step for Cargotest {
builder,
cmd.arg(&cargo)
.arg(&out_dir)
.args(builder.config.cmd.test_args())
.env("RUSTC", builder.rustc(compiler))
.env("RUSTDOC", builder.rustdoc(compiler)),
);

View file

@ -85,7 +85,9 @@ fn main() {
let cargo = &Path::new(cargo);
for test in TEST_REPOS.iter().rev() {
test_repo(cargo, out_dir, test);
if args[3..].is_empty() || args[3..].iter().any(|s| s.contains(test.name)) {
test_repo(cargo, out_dir, test);
}
}
}