Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove error code check in doc test #6027

Merged
merged 3 commits into from
Sep 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions tests/testsuite/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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 ([..])
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
13 changes: 5 additions & 8 deletions tests/testsuite/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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();
Expand Down
8 changes: 8 additions & 0 deletions tests/testsuite/support/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down