diff options
| author | Oliver Middleton <olliemail27@gmail.com> | 2019-05-26 00:11:30 +0100 |
|---|---|---|
| committer | Oliver Middleton <olliemail27@gmail.com> | 2019-06-08 18:26:06 +0100 |
| commit | 6c747e030381ac8757274ba5bd6b7340aa0e63e6 (patch) | |
| tree | 59009af014c65ae74f3801adcbaee7f108aced57 | |
| parent | 6cc42ce286b1a0693acc4ed2db9d9aa64ec16be1 (diff) | |
| download | rust-6c747e030381ac8757274ba5bd6b7340aa0e63e6.tar.gz rust-6c747e030381ac8757274ba5bd6b7340aa0e63e6.zip | |
Fix tests after revert of rustdoc cfg(test) feature
| -rw-r--r-- | src/test/rustdoc-ui/cfg-test.rs | 7 | ||||
| -rw-r--r-- | src/test/rustdoc-ui/cfg-test.stdout | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/test/rustdoc-ui/cfg-test.rs b/src/test/rustdoc-ui/cfg-test.rs index e26034371f4..6112e9b30e8 100644 --- a/src/test/rustdoc-ui/cfg-test.rs +++ b/src/test/rustdoc-ui/cfg-test.rs @@ -2,12 +2,15 @@ // compile-flags:--test // normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR" +// Crates like core have doctests gated on `cfg(not(test))` so we need to make +// sure `cfg(test)` is not active when running `rustdoc --test`. + /// this doctest will be ignored: /// /// ``` /// assert!(false); /// ``` -#[cfg(not(test))] +#[cfg(test)] pub struct Foo; /// this doctest will be tested: @@ -15,5 +18,5 @@ pub struct Foo; /// ``` /// assert!(true); /// ``` -#[cfg(test)] +#[cfg(not(test))] pub struct Foo; diff --git a/src/test/rustdoc-ui/cfg-test.stdout b/src/test/rustdoc-ui/cfg-test.stdout index 30bb0038d1b..67873870e89 100644 --- a/src/test/rustdoc-ui/cfg-test.stdout +++ b/src/test/rustdoc-ui/cfg-test.stdout @@ -1,6 +1,6 @@ running 1 test -test $DIR/cfg-test.rs - Foo (line 15) ... ok +test $DIR/cfg-test.rs - Foo (line 18) ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out |
