diff --git a/src/test/rustdoc-ui/failed-doctest-output.rs b/src/test/rustdoc-ui/failed-doctest-output.rs new file mode 100644 index 00000000000..587a5def2dd --- /dev/null +++ b/src/test/rustdoc-ui/failed-doctest-output.rs @@ -0,0 +1,19 @@ +// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Issue #51162: A failed doctest was not printing its stdout/stderr + +// compile-flags:--test +// disable-ui-testing-normalization + +/// ``` +/// panic!("oh no"); +/// ``` +pub struct SomeStruct; diff --git a/src/test/rustdoc-ui/failed-doctest-output.stdout b/src/test/rustdoc-ui/failed-doctest-output.stdout new file mode 100644 index 00000000000..78cc0370d31 --- /dev/null +++ b/src/test/rustdoc-ui/failed-doctest-output.stdout @@ -0,0 +1,21 @@ + +running 1 test +test src/test/rustdoc-ui/failed-doctest-output.rs - SomeStruct (line 16) ... FAILED + +failures: + +---- src/test/rustdoc-ui/failed-doctest-output.rs - SomeStruct (line 16) stdout ---- +thread 'src/test/rustdoc-ui/failed-doctest-output.rs - SomeStruct (line 16)' panicked at 'test executable failed: + +thread 'main' panicked at 'oh no', src/test/rustdoc-ui/failed-doctest-output.rs:3:1 +note: Run with `RUST_BACKTRACE=1` for a backtrace. + +', librustdoc/test.rs:367:17 +note: Run with `RUST_BACKTRACE=1` for a backtrace. + + +failures: + src/test/rustdoc-ui/failed-doctest-output.rs - SomeStruct (line 16) + +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out +