Skip to content

Commit a31aaac

Browse files
committed
test: move --keep-going suggestion match tests to UI tests
We don't want to overly match to suggestion help from clap.
1 parent 4d09585 commit a31aaac

14 files changed

Lines changed: 60 additions & 46 deletions

File tree

tests/testsuite/bench.rs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1671,29 +1671,6 @@ fn json_artifact_includes_executable_for_benchmark() {
16711671
.run();
16721672
}
16731673

1674-
#[cargo_test]
1675-
fn cargo_bench_no_keep_going() {
1676-
let p = project()
1677-
.file("Cargo.toml", &basic_bin_manifest("foo"))
1678-
.file("src/main.rs", "")
1679-
.build();
1680-
1681-
p.cargo("bench --keep-going")
1682-
.with_stderr(
1683-
"\
1684-
error: unexpected argument '--keep-going' found
1685-
1686-
tip: use `--no-fail-fast` to run as many tests as possible regardless of failure
1687-
1688-
Usage: cargo bench [OPTIONS] [BENCHNAME] [-- [args]...]
1689-
1690-
For more information, try '--help'.
1691-
",
1692-
)
1693-
.with_status(1)
1694-
.run();
1695-
}
1696-
16971674
#[cargo_test(nightly, reason = "bench")]
16981675
fn cargo_bench_print_env_verbose() {
16991676
let p = project()

tests/testsuite/cargo_bench/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
mod help;
2+
mod no_keep_going;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[package]
2+
name = "foo"
3+
version = "0.1.0"

tests/testsuite/cargo_bench/no_keep_going/in/src/lib.rs

Whitespace-only changes.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
use cargo_test_support::curr_dir;
2+
use cargo_test_support::CargoCommand;
3+
use cargo_test_support::Project;
4+
5+
#[cargo_test]
6+
fn case() {
7+
let project = Project::from_template(curr_dir!().join("in"));
8+
let project_root = project.root();
9+
let cwd = &project_root;
10+
11+
snapbox::cmd::Command::cargo_ui()
12+
.arg("bench")
13+
.arg("--keep-going")
14+
.current_dir(cwd)
15+
.assert()
16+
.code(1)
17+
.stdout_matches_path(curr_dir!().join("stdout.log"))
18+
.stderr_matches_path(curr_dir!().join("stderr.log"));
19+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
error: unexpected argument '--keep-going' found
2+
3+
tip: use `--no-fail-fast` to run as many tests as possible regardless of failure
4+
5+
Usage: cargo bench [OPTIONS] [BENCHNAME] [-- [args]...]
6+
7+
For more information, try '--help'.

tests/testsuite/cargo_bench/no_keep_going/stdout.log

Whitespace-only changes.

tests/testsuite/cargo_test/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
mod help;
2+
mod no_keep_going;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[package]
2+
name = "foo"
3+
version = "0.1.0"

tests/testsuite/cargo_test/no_keep_going/in/src/lib.rs

Whitespace-only changes.

0 commit comments

Comments
 (0)