Skip to content

Commit d965371

Browse files
normalize test output so it can be run from repo root
1 parent ffbd2b9 commit d965371

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

src/test/rustdoc-ui/failed-doctest-output.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,19 @@
99
// except according to those terms.
1010

1111
// Issue #51162: A failed doctest was not printing its stdout/stderr
12+
// FIXME: if/when the output of the test harness can be tested on its own, this test should be
13+
// adapted to use that, and that normalize line can go away
1214

1315
// compile-flags:--test
14-
// disable-ui-testing-normalization
16+
// normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
1517

18+
// doctest fails at runtime
1619
/// ```
1720
/// panic!("oh no");
1821
/// ```
1922
pub struct SomeStruct;
2023

24+
// doctest fails at compile time
2125
/// ```
2226
/// no
2327
/// ```
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11

22
running 2 tests
3-
test $DIR/failed-doctest-output.rs - OtherStruct (line 21) ... FAILED
4-
test $DIR/failed-doctest-output.rs - SomeStruct (line 16) ... FAILED
3+
test $DIR/failed-doctest-output.rs - OtherStruct (line 25) ... FAILED
4+
test $DIR/failed-doctest-output.rs - SomeStruct (line 19) ... FAILED
55

66
failures:
77

8-
---- $DIR/failed-doctest-output.rs - OtherStruct (line 21) stdout ----
8+
---- $DIR/failed-doctest-output.rs - OtherStruct (line 25) stdout ----
99
error[E0425]: cannot find value `no` in this scope
10-
--> $DIR/failed-doctest-output.rs:22:1
10+
--> $DIR/failed-doctest-output.rs:26:1
1111
|
1212
3 | no
1313
| ^^ not found in this scope
1414

15-
thread '$DIR/failed-doctest-output.rs - OtherStruct (line 21)' panicked at 'couldn't compile the test', librustdoc/test.rs:332:13
15+
thread '$DIR/failed-doctest-output.rs - OtherStruct (line 25)' panicked at 'couldn't compile the test', librustdoc/test.rs:332:13
1616
note: Run with `RUST_BACKTRACE=1` for a backtrace.
1717

18-
---- $DIR/failed-doctest-output.rs - SomeStruct (line 16) stdout ----
19-
thread '$DIR/failed-doctest-output.rs - SomeStruct (line 16)' panicked at 'test executable failed:
18+
---- $DIR/failed-doctest-output.rs - SomeStruct (line 19) stdout ----
19+
thread '$DIR/failed-doctest-output.rs - SomeStruct (line 19)' panicked at 'test executable failed:
2020

2121
thread 'main' panicked at 'oh no', $DIR/failed-doctest-output.rs:3:1
2222
note: Run with `RUST_BACKTRACE=1` for a backtrace.
@@ -25,8 +25,8 @@ note: Run with `RUST_BACKTRACE=1` for a backtrace.
2525

2626

2727
failures:
28-
$DIR/failed-doctest-output.rs - OtherStruct (line 21)
29-
$DIR/failed-doctest-output.rs - SomeStruct (line 16)
28+
$DIR/failed-doctest-output.rs - OtherStruct (line 25)
29+
$DIR/failed-doctest-output.rs - SomeStruct (line 19)
3030

3131
test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out
3232

0 commit comments

Comments
 (0)