Rollup merge of #110981 - jyn514:rustdoc-tests, r=notriddle
Move most rustdoc-ui tests into subdirectories This makes it easier to know where to add a new test, and makes the top-level directory less overwhelming.
This commit is contained in:
commit
4b79276e60
@ -1,6 +1,6 @@
|
|||||||
// check-pass
|
// check-pass
|
||||||
// compile-flags:--test --test-args --test-threads=1
|
// compile-flags:--test --test-args --test-threads=1
|
||||||
// normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
|
// normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
|
||||||
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||||
|
|
||||||
// Crates like core have doctests gated on `cfg(not(test))` so we need to make
|
// Crates like core have doctests gated on `cfg(not(test))` so we need to make
|
@ -1,7 +1,7 @@
|
|||||||
// check-pass
|
// check-pass
|
||||||
// compile-flags: --test --nocapture --check-cfg=values(feature,"test") -Z unstable-options
|
// compile-flags: --test --nocapture --check-cfg=values(feature,"test") -Z unstable-options
|
||||||
// normalize-stderr-test: "tests/rustdoc-ui" -> "$$DIR"
|
// normalize-stderr-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
|
||||||
// normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
|
// normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
|
||||||
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||||
|
|
||||||
/// The doctest will produce a warning because feature invalid is unexpected
|
/// The doctest will produce a warning because feature invalid is unexpected
|
11
tests/rustdoc-ui/doctest/check-cfg-test.stderr
Normal file
11
tests/rustdoc-ui/doctest/check-cfg-test.stderr
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
warning: unexpected `cfg` condition value
|
||||||
|
--> $DIR/check-cfg-test.rs:9:7
|
||||||
|
|
|
||||||
|
LL | #[cfg(feature = "invalid")]
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
||||||
|
= note: expected values for `feature` are: test
|
||||||
|
= note: `#[warn(unexpected_cfgs)]` on by default
|
||||||
|
|
||||||
|
warning: 1 warning emitted
|
||||||
|
|
@ -3,7 +3,7 @@
|
|||||||
// check-pass
|
// check-pass
|
||||||
// edition:2018
|
// edition:2018
|
||||||
// compile-flags:--test --test-args=--show-output
|
// compile-flags:--test --test-args=--show-output
|
||||||
// normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
|
// normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
|
||||||
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||||
|
|
||||||
/// ```
|
/// ```
|
@ -1,6 +1,6 @@
|
|||||||
// Regression test for #97440: Multiline inner attribute triggers ICE during doctest
|
// Regression test for #97440: Multiline inner attribute triggers ICE during doctest
|
||||||
// compile-flags:--test
|
// compile-flags:--test
|
||||||
// normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
|
// normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
|
||||||
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||||
// check-pass
|
// check-pass
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
// compile-flags:--test
|
// compile-flags:--test
|
||||||
// normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
|
// normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
|
||||||
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||||
// check-pass
|
// check-pass
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
// check-pass
|
// check-pass
|
||||||
// compile-flags:--test
|
// compile-flags:--test
|
||||||
// normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
|
// normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
|
||||||
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||||
|
|
||||||
// Make sure `cfg(doctest)` is set when finding doctests but not inside
|
// Make sure `cfg(doctest)` is set when finding doctests but not inside
|
@ -1,6 +1,6 @@
|
|||||||
// check-pass
|
// check-pass
|
||||||
// compile-flags:--test
|
// compile-flags:--test
|
||||||
// normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
|
// normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
|
||||||
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||||
|
|
||||||
#![feature(doc_cfg)]
|
#![feature(doc_cfg)]
|
@ -1,5 +1,5 @@
|
|||||||
// compile-flags:--test --test-args=--test-threads=1
|
// compile-flags:--test --test-args=--test-threads=1
|
||||||
// normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
|
// normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
|
||||||
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||||
// check-pass
|
// check-pass
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
// edition:2018
|
// edition:2018
|
||||||
// aux-build:extern_macros.rs
|
// aux-build:extern_macros.rs
|
||||||
// compile-flags:--test --test-args=--test-threads=1
|
// compile-flags:--test --test-args=--test-threads=1
|
||||||
// normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
|
// normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
|
||||||
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||||
// check-pass
|
// check-pass
|
||||||
|
|
@ -2,7 +2,7 @@
|
|||||||
// adapted to use that, and that normalize line can go away
|
// adapted to use that, and that normalize line can go away
|
||||||
|
|
||||||
// compile-flags:--test
|
// compile-flags:--test
|
||||||
// normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
|
// normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
|
||||||
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||||
// failure-status: 101
|
// failure-status: 101
|
||||||
|
|
@ -2,7 +2,7 @@
|
|||||||
// adapted to use that, and that normalize line can go away
|
// adapted to use that, and that normalize line can go away
|
||||||
|
|
||||||
// compile-flags:--test
|
// compile-flags:--test
|
||||||
// normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
|
// normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
|
||||||
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||||
// failure-status: 101
|
// failure-status: 101
|
||||||
|
|
@ -2,7 +2,7 @@
|
|||||||
// adapted to use that, and that normalize line can go away
|
// adapted to use that, and that normalize line can go away
|
||||||
|
|
||||||
// compile-flags:--test
|
// compile-flags:--test
|
||||||
// normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
|
// normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
|
||||||
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||||
// failure-status: 101
|
// failure-status: 101
|
||||||
|
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
// compile-flags:--test --test-args --test-threads=1
|
// compile-flags:--test --test-args --test-threads=1
|
||||||
// rustc-env:RUST_BACKTRACE=0
|
// rustc-env:RUST_BACKTRACE=0
|
||||||
// normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
|
// normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
|
||||||
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||||
// failure-status: 101
|
// failure-status: 101
|
||||||
|
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
// compile-flags:--test --test-args --test-threads=1
|
// compile-flags:--test --test-args --test-threads=1
|
||||||
// rustc-env:RUST_BACKTRACE=0
|
// rustc-env:RUST_BACKTRACE=0
|
||||||
// normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
|
// normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
|
||||||
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||||
// failure-status: 101
|
// failure-status: 101
|
||||||
|
|
@ -2,7 +2,7 @@
|
|||||||
// adapted to use that, and that normalize line can go away
|
// adapted to use that, and that normalize line can go away
|
||||||
|
|
||||||
// compile-flags:--test
|
// compile-flags:--test
|
||||||
// normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
|
// normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
|
||||||
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||||
// failure-status: 101
|
// failure-status: 101
|
||||||
|
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// check-pass
|
// check-pass
|
||||||
// compile-flags:-Z unstable-options --test --no-run --test-args=--test-threads=1
|
// compile-flags:-Z unstable-options --test --no-run --test-args=--test-threads=1
|
||||||
// normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
|
// normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
|
||||||
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||||
|
|
||||||
/// ```
|
/// ```
|
@ -1,7 +1,7 @@
|
|||||||
// check-pass
|
// check-pass
|
||||||
// compile-flags:--test -Zunstable-options --nocapture
|
// compile-flags:--test -Zunstable-options --nocapture
|
||||||
// normalize-stderr-test: "tests/rustdoc-ui" -> "$$DIR"
|
// normalize-stderr-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
|
||||||
// normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
|
// normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
|
||||||
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||||
|
|
||||||
/// ```compile_fail
|
/// ```compile_fail
|
@ -1,6 +1,6 @@
|
|||||||
// check-pass
|
// check-pass
|
||||||
// compile-flags:--test -Zunstable-options --nocapture
|
// compile-flags:--test -Zunstable-options --nocapture
|
||||||
// normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
|
// normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
|
||||||
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||||
|
|
||||||
/// ```
|
/// ```
|
@ -4,12 +4,12 @@
|
|||||||
// check-pass
|
// check-pass
|
||||||
// [correct]compile-flags:--test --test-run-directory={{src-base}}
|
// [correct]compile-flags:--test --test-run-directory={{src-base}}
|
||||||
// [incorrect]compile-flags:--test --test-run-directory={{src-base}}/coverage
|
// [incorrect]compile-flags:--test --test-run-directory={{src-base}}/coverage
|
||||||
// normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
|
// normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
|
||||||
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||||
|
|
||||||
/// ```
|
/// ```
|
||||||
/// assert_eq!(
|
/// assert_eq!(
|
||||||
/// std::fs::read_to_string("run-directory.rs").unwrap(),
|
/// std::fs::read_to_string("doctest/run-directory.rs").unwrap(),
|
||||||
/// include_str!("run-directory.rs"),
|
/// include_str!("run-directory.rs"),
|
||||||
/// );
|
/// );
|
||||||
/// ```
|
/// ```
|
||||||
@ -17,7 +17,7 @@
|
|||||||
pub fn foo() {}
|
pub fn foo() {}
|
||||||
|
|
||||||
/// ```
|
/// ```
|
||||||
/// assert!(std::fs::read_to_string("run-directory.rs").is_err());
|
/// assert!(std::fs::read_to_string("doctest/run-directory.rs").is_err());
|
||||||
/// ```
|
/// ```
|
||||||
#[cfg(incorrect)]
|
#[cfg(incorrect)]
|
||||||
pub fn foo() {}
|
pub fn foo() {}
|
@ -1,5 +1,5 @@
|
|||||||
// compile-flags:--test
|
// compile-flags:--test
|
||||||
// normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
|
// normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
|
||||||
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||||
// check-pass
|
// check-pass
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
// compile-flags: --test --test-args=--test-threads=1
|
// compile-flags: --test --test-args=--test-threads=1
|
||||||
// check-pass
|
// check-pass
|
||||||
// normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
|
// normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
|
||||||
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||||
|
|
||||||
/// ```
|
/// ```
|
@ -1,5 +1,5 @@
|
|||||||
// compile-flags: --test
|
// compile-flags: --test
|
||||||
// normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
|
// normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
|
||||||
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||||
// failure-status: 101
|
// failure-status: 101
|
||||||
// rustc-env: RUST_BACKTRACE=0
|
// rustc-env: RUST_BACKTRACE=0
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user