Test cleanup: remove unnecessary with_status(0)

This commit is contained in:
Dale Wijnand 2019-02-04 18:52:33 +01:00
parent 0dbb2fc15f
commit 37df042ba8
No known key found for this signature in database
GPG Key ID: 4F256E3D151DF5EF
8 changed files with 5 additions and 29 deletions

View File

@ -4628,13 +4628,11 @@ Did you mean `ex1`?",
.run(); .run();
ws.cargo("build -v --lib") ws.cargo("build -v --lib")
.with_status(0)
.with_stderr_contains("[RUNNING] `rustc [..]a/src/lib.rs[..]") .with_stderr_contains("[RUNNING] `rustc [..]a/src/lib.rs[..]")
.with_stderr_contains("[RUNNING] `rustc [..]b/src/lib.rs[..]") .with_stderr_contains("[RUNNING] `rustc [..]b/src/lib.rs[..]")
.run(); .run();
ws.cargo("build -v --example ex1") ws.cargo("build -v --example ex1")
.with_status(0)
.with_stderr_contains("[RUNNING] `rustc [..]a/examples/ex1.rs[..]") .with_stderr_contains("[RUNNING] `rustc [..]a/examples/ex1.rs[..]")
.run(); .run();
} }

View File

@ -713,7 +713,6 @@ fn workspace_different_locations() {
p.cargo("build").cwd(p.root().join("foo")).run(); p.cargo("build").cwd(p.root().join("foo")).run();
p.cargo("build") p.cargo("build")
.cwd(p.root().join("bar")) .cwd(p.root().join("bar"))
.with_status(0)
.with_stderr( .with_stderr(
"\ "\
[COMPILING] bar [..] [COMPILING] bar [..]

View File

@ -32,8 +32,5 @@ fn edition_works_for_build_script() {
.file("a/src/lib.rs", "pub fn foo() {}") .file("a/src/lib.rs", "pub fn foo() {}")
.build(); .build();
p.cargo("build -v") p.cargo("build -v").masquerade_as_nightly_cargo().run();
.masquerade_as_nightly_cargo()
.with_status(0)
.run();
} }

View File

@ -943,7 +943,6 @@ fn fix_idioms() {
"; ";
p.cargo("fix --edition-idioms --allow-no-vcs") p.cargo("fix --edition-idioms --allow-no-vcs")
.with_stderr(stderr) .with_stderr(stderr)
.with_status(0)
.run(); .run();
assert!(p.read_file("src/lib.rs").contains("Box<dyn Any>")); assert!(p.read_file("src/lib.rs").contains("Box<dyn Any>"));
@ -955,7 +954,6 @@ fn idioms_2015_ok() {
p.cargo("fix --edition-idioms --allow-no-vcs") p.cargo("fix --edition-idioms --allow-no-vcs")
.masquerade_as_nightly_cargo() .masquerade_as_nightly_cargo()
.with_status(0)
.run(); .run();
} }

View File

@ -1263,10 +1263,7 @@ fn package_with_select_features() {
) )
.build(); .build();
p.cargo("package --features required") p.cargo("package --features required").masquerade_as_nightly_cargo().run();
.masquerade_as_nightly_cargo()
.with_status(0)
.run();
} }
#[test] #[test]
@ -1295,10 +1292,7 @@ fn package_with_all_features() {
) )
.build(); .build();
p.cargo("package --all-features") p.cargo("package --all-features").masquerade_as_nightly_cargo().run();
.masquerade_as_nightly_cargo()
.with_status(0)
.run();
} }
#[test] #[test]

View File

@ -635,7 +635,6 @@ required by package `foo v0.0.1 ([..])`
.run(); .run();
p.cargo("update -p baz") p.cargo("update -p baz")
.with_status(0)
.with_stderr_contains( .with_stderr_contains(
"\ "\
[UPDATING] `[..]` index [UPDATING] `[..]` index

View File

@ -1098,10 +1098,7 @@ fn run_workspace() {
available binaries: a, b", available binaries: a, b",
) )
.run(); .run();
p.cargo("run --bin a") p.cargo("run --bin a").with_stdout("run-a").run();
.with_status(0)
.with_stdout("run-a")
.run();
} }
#[test] #[test]
@ -1130,11 +1127,7 @@ fn default_run_workspace() {
.file("b/src/main.rs", r#"fn main() {println!("run-b");}"#) .file("b/src/main.rs", r#"fn main() {println!("run-b");}"#)
.build(); .build();
p.cargo("run") p.cargo("run").masquerade_as_nightly_cargo().with_stdout("run-a").run();
.masquerade_as_nightly_cargo()
.with_status(0)
.with_stdout("run-a")
.run();
} }
#[test] #[test]

View File

@ -2074,7 +2074,6 @@ fn ws_warn_unused() {
.file("a/src/lib.rs", "") .file("a/src/lib.rs", "")
.build(); .build();
p.cargo("check") p.cargo("check")
.with_status(0)
.with_stderr_contains(&format!( .with_stderr_contains(&format!(
"\ "\
[WARNING] {} for the non root package will be ignored, specify {} at the workspace root: [WARNING] {} for the non root package will be ignored, specify {} at the workspace root:
@ -2111,7 +2110,6 @@ fn ws_warn_path() {
.build(); .build();
p.cargo("check") p.cargo("check")
.with_status(0)
.with_stderr_contains("[WARNING] [..]/foo/a/Cargo.toml: the cargo feature `edition`[..]") .with_stderr_contains("[WARNING] [..]/foo/a/Cargo.toml: the cargo feature `edition`[..]")
.run(); .run();
} }