diff --git a/tests/testsuite/build.rs b/tests/testsuite/build.rs index 77d127a1bd8..a422ec68206 100644 --- a/tests/testsuite/build.rs +++ b/tests/testsuite/build.rs @@ -3938,10 +3938,6 @@ fn inferred_benchmarks() { #[test] fn target_edition() { - if !is_nightly() { - // --edition is nightly-only - return; - } let p = project() .file( "Cargo.toml", @@ -3957,6 +3953,7 @@ fn target_edition() { .build(); p.cargo("build -v") + .without_status() // passes on nightly, fails on stable, b/c --edition is nightly-only .with_stderr_contains( "\ [COMPILING] foo v0.0.1 ([..]) diff --git a/tests/testsuite/doc.rs b/tests/testsuite/doc.rs index a5b52b2bb42..c63db518cd3 100644 --- a/tests/testsuite/doc.rs +++ b/tests/testsuite/doc.rs @@ -635,7 +635,7 @@ fn output_not_captured() { ).build(); p.cargo("doc") - .with_status(101) + .without_status() .with_stderr_contains("1 | ☃") .with_stderr_contains(r"error: unknown start of token: \u{2603}") .run(); diff --git a/tests/testsuite/package.rs b/tests/testsuite/package.rs index f52b3cece44..b9c1cae0451 100644 --- a/tests/testsuite/package.rs +++ b/tests/testsuite/package.rs @@ -932,10 +932,6 @@ fn package_two_kinds_of_deps() { #[test] fn test_edition() { - if !is_nightly() { - // --edition is nightly-only - return; - } let p = project() .file( "Cargo.toml", @@ -951,10 +947,11 @@ fn test_edition() { .build(); p.cargo("build -v").masquerade_as_nightly_cargo() - // --edition is still in flux and we're not passing -Zunstable-options - // from Cargo so it will probably error. Only partially match the output - // until stuff stabilizes - .with_stderr_contains("\ + .without_status() // passes on nightly, fails on stable, b/c --edition is nightly-only + // --edition is still in flux and we're not passing -Zunstable-options + // from Cargo so it will probably error. Only partially match the output + // until stuff stabilizes + .with_stderr_contains("\ [COMPILING] foo v0.0.1 ([..]) [RUNNING] `rustc [..]--edition=2018 [..] ").run(); diff --git a/tests/testsuite/support/mod.rs b/tests/testsuite/support/mod.rs index c184d544d47..b217527b8b8 100644 --- a/tests/testsuite/support/mod.rs +++ b/tests/testsuite/support/mod.rs @@ -566,6 +566,14 @@ impl Execs { self } + /// Remove exit code check for the process. + /// + /// By default, the expected exit code is `0`. + pub fn without_status(&mut self) -> &mut Self { + self.expect_exit_code = None; + self + } + /// Verify that stdout contains the given contiguous lines somewhere in /// its output. /// See `lines_match` for supported patterns.