Skip to content

Commit

Permalink
Rollup merge of #84779 - jyn514:cargotest-args, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
Add support for --test-args to cargotest

This allows running a single test without having to wait for all tests
to complete.

Closes #77260.
  • Loading branch information
JohnTitor committed May 7, 2021
2 parents 1773f14 + d95a6cf commit 2d496f4
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 2d496f4

Please sign in to comment.