Skip to content

Commit

Permalink
Add support for --test-args to cargotest
Browse files Browse the repository at this point in the history
This allows running a single test without having to wait for all tests
to complete.
  • Loading branch information
jyn514 committed May 1, 2021
1 parent b52769b commit d95a6cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/bootstrap/test.rs
Expand Up @@ -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)),
);
Expand Down
4 changes: 3 additions & 1 deletion src/tools/cargotest/main.rs
Expand Up @@ -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);
}
}
}

Expand Down

0 comments on commit d95a6cf

Please sign in to comment.