Skip to content

Commit dd4f46e

Browse files
committed
Auto merge of #5135 - matklad:drop-ignored-tests, r=alexcrichton
Drop ignored tests r? @alexcrichton These tests are ignored, so its better to remove them. `run` does not supports `--bins` argument, so I've left a single test that checks specifically for this. cc #3901
2 parents c721937 + 96a4aa8 commit dd4f46e

File tree

1 file changed

+4
-108
lines changed

1 file changed

+4
-108
lines changed

tests/testsuite/run.rs

Lines changed: 4 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -28,33 +28,6 @@ hello
2828
assert_that(&p.bin("foo"), existing_file());
2929
}
3030

31-
#[test]
32-
#[ignore]
33-
fn simple_implicit_main() {
34-
let p = project("foo")
35-
.file("Cargo.toml", r#"
36-
[project]
37-
name = "foo"
38-
version = "0.0.1"
39-
authors = []
40-
"#)
41-
.file("src/main.rs", r#"
42-
fn main() { println!("hello world"); }
43-
"#)
44-
.build();
45-
46-
assert_that(p.cargo("run").arg("--bins"),
47-
execs().with_status(0)
48-
.with_stderr(&format!("\
49-
[COMPILING] foo v0.0.1 ({dir})
50-
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
51-
[RUNNING] `target[/]debug[/]foo[EXE]`", dir = path2url(p.root())))
52-
.with_stdout("\
53-
hello
54-
"));
55-
assert_that(&p.bin("foo"), existing_file());
56-
}
57-
5831
#[test]
5932
fn simple_quiet() {
6033
let p = project("foo")
@@ -215,25 +188,6 @@ fn no_main_file() {
215188
for `cargo run`\n"));
216189
}
217190

218-
#[test]
219-
#[ignore]
220-
fn no_main_file_implicit() {
221-
let p = project("foo")
222-
.file("Cargo.toml", r#"
223-
[project]
224-
name = "foo"
225-
version = "0.0.1"
226-
authors = []
227-
"#)
228-
.file("src/lib.rs", "")
229-
.build();
230-
231-
assert_that(p.cargo("run").arg("--bins"),
232-
execs().with_status(101)
233-
.with_stderr("[ERROR] a bin target must be available \
234-
for `cargo run`\n"));
235-
}
236-
237191
#[test]
238192
fn too_many_bins() {
239193
let p = project("foo")
@@ -255,28 +209,6 @@ fn too_many_bins() {
255209
to specify which one to run\navailable binaries: [..]\n"));
256210
}
257211

258-
#[test]
259-
#[ignore]
260-
fn too_many_bins_implicit() {
261-
let p = project("foo")
262-
.file("Cargo.toml", r#"
263-
[project]
264-
name = "foo"
265-
version = "0.0.1"
266-
authors = []
267-
"#)
268-
.file("src/lib.rs", "")
269-
.file("src/bin/a.rs", "")
270-
.file("src/bin/b.rs", "")
271-
.build();
272-
273-
assert_that(p.cargo("run").arg("--bins"),
274-
execs().with_status(101)
275-
.with_stderr("[ERROR] `cargo run` requires that a project only \
276-
have one executable; use the `--bin` option \
277-
to specify which one to run\navailable binaries: [..]\n"));
278-
}
279-
280212
#[test]
281213
fn specify_name() {
282214
let p = project("foo")
@@ -353,8 +285,7 @@ example
353285
}
354286

355287
#[test]
356-
#[ignore]
357-
fn run_bin_implicit() {
288+
fn run_bins() {
358289
let p = project("foo")
359290
.file("Cargo.toml", r#"
360291
[project]
@@ -372,44 +303,9 @@ fn run_bin_implicit() {
372303
.build();
373304

374305
assert_that(p.cargo("run").arg("--bins"),
375-
execs().with_status(0)
376-
.with_stderr(&format!("\
377-
[COMPILING] foo v0.0.1 ({dir})
378-
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
379-
[RUNNING] `target[/]debug[/]examples[/]a[EXE]`", dir = path2url(p.root())))
380-
.with_stdout("\
381-
bin
382-
"));
383-
}
384-
385-
#[test]
386-
#[ignore]
387-
fn run_example_implicit() {
388-
let p = project("foo")
389-
.file("Cargo.toml", r#"
390-
[project]
391-
name = "foo"
392-
version = "0.0.1"
393-
authors = []
394-
"#)
395-
.file("src/lib.rs", "")
396-
.file("examples/a.rs", r#"
397-
fn main() { println!("example"); }
398-
"#)
399-
.file("src/bin/a.rs", r#"
400-
fn main() { println!("bin"); }
401-
"#)
402-
.build();
403-
404-
assert_that(p.cargo("run").arg("--examples"),
405-
execs().with_status(0)
406-
.with_stderr(&format!("\
407-
[COMPILING] foo v0.0.1 ({dir})
408-
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
409-
[RUNNING] `target[/]debug[/]examples[/]a[EXE]`", dir = path2url(p.root())))
410-
.with_stdout("\
411-
example
412-
"));
306+
execs().with_status(1)
307+
.with_stderr_contains("\
308+
[ERROR] Unknown flag: '--bins'. Did you mean '--bin'?"));
413309
}
414310

415311
#[test]

0 commit comments

Comments
 (0)