add ui test for failing doctest

This commit is contained in:
QuietMisdreavus 2018-07-09 14:26:22 -05:00
parent d17a378b16
commit 33654195a1
2 changed files with 40 additions and 0 deletions

View file

@ -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 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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;

View file

@ -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