We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8ed2292 commit 459d677Copy full SHA for 459d677
src/test/rustdoc-ui/cfg-test.rs
@@ -0,0 +1,19 @@
1
+// compile-pass
2
+// compile-flags:--test
3
+// normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
4
+
5
+/// this doctest will be ignored:
6
+///
7
+/// ```
8
+/// assert!(false);
9
10
+#[cfg(not(test))]
11
+pub struct Foo;
12
13
+/// this doctest will be tested:
14
15
16
+/// assert!(true);
17
18
+#[cfg(test)]
19
src/test/rustdoc-ui/cfg-test.stdout
@@ -0,0 +1,6 @@
+running 1 test
+test $DIR/cfg-test.rs - Foo (line 15) ... ok
+test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
0 commit comments