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

rustdoc doctest: include signal number in exit status #95783

Merged
merged 5 commits into from
Apr 12, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
8 changes: 1 addition & 7 deletions src/librustdoc/doctest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1069,13 +1069,7 @@ impl Tester for Collector {
}
}
TestFailure::ExecutionFailure(out) => {
let reason = if let Some(code) = out.status.code() {
format!("exit code {code}")
} else {
String::from("terminated by signal")
};

eprintln!("Test executable failed ({reason}).");
eprintln!("Test executable failed ({reason}).", reason = out.status);

// FIXME(#12309): An unfortunate side-effect of capturing the test
// executable's output is that the relative ordering between the test's
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/failed-doctest-output.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ error: aborting due to previous error
For more information about this error, try `rustc --explain E0425`.
Couldn't compile the test.
---- $DIR/failed-doctest-output.rs - SomeStruct (line 12) stdout ----
Test executable failed (exit code 101).
Test executable failed (exit status: 101).

stdout:
stdout 1
Expand Down