Fix tests after revert of rustdoc cfg(test) feature
This commit is contained in:
parent
6cc42ce286
commit
6c747e0303
2 changed files with 6 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue