-
Notifications
You must be signed in to change notification settings - Fork 13.4k
rustdoc doctest: include signal number in exit status #95783
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
813b93e
rustdoc doctest: include signal number in exit status
notriddle 898ff01
Fix test case
notriddle dae1df6
Fix test case for windows
notriddle daa903c
Fix line numbers
notriddle 2af843c
Update src/test/rustdoc-ui/failed-doctest-output-windows.rs
notriddle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// only-windows | ||
// There's a parallel generic version of this test for POSIXy platforms. | ||
|
||
// Issue #51162: A failed doctest was not printing its stdout/stderr | ||
// FIXME: if/when the output of the test harness can be tested on its own, this test should be | ||
// adapted to use that, and that normalize line can go away | ||
|
||
// compile-flags:--test --test-args --test-threads=1 | ||
// rustc-env:RUST_BACKTRACE=0 | ||
// normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR" | ||
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME" | ||
// failure-status: 101 | ||
|
||
// doctest fails at runtime | ||
/// ``` | ||
/// println!("stdout 1"); | ||
/// eprintln!("stderr 1"); | ||
/// println!("stdout 2"); | ||
/// eprintln!("stderr 2"); | ||
/// panic!("oh no"); | ||
/// ``` | ||
pub struct SomeStruct; | ||
|
||
// doctest fails at compile time | ||
/// ``` | ||
/// no | ||
/// ``` | ||
pub struct OtherStruct; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
running 2 tests | ||
test $DIR/failed-doctest-output-windows.rs - OtherStruct (line 25) ... FAILED | ||
test $DIR/failed-doctest-output-windows.rs - SomeStruct (line 15) ... FAILED | ||
|
||
failures: | ||
|
||
---- $DIR/failed-doctest-output-windows.rs - OtherStruct (line 25) stdout ---- | ||
error[E0425]: cannot find value `no` in this scope | ||
--> $DIR/failed-doctest-output-windows.rs:26:1 | ||
| | ||
LL | no | ||
| ^^ not found in this scope | ||
|
||
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-windows.rs - SomeStruct (line 15) stdout ---- | ||
Test executable failed (exit code: 101). | ||
|
||
stdout: | ||
stdout 1 | ||
stdout 2 | ||
|
||
stderr: | ||
stderr 1 | ||
stderr 2 | ||
thread 'main' panicked at 'oh no', $DIR/failed-doctest-output-windows.rs:7:1 | ||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace | ||
|
||
|
||
|
||
failures: | ||
$DIR/failed-doctest-output-windows.rs - OtherStruct (line 25) | ||
$DIR/failed-doctest-output-windows.rs - SomeStruct (line 15) | ||
|
||
test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.