Skip to content

Commit 1e7b581

Browse files
Add regression test for --doctest-compilation-args
1 parent c228271 commit 1e7b581

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

tests/rustdoc-ui/doctest/rustflags.rs

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//@ check-pass
2+
//@ compile-flags: --test -Zunstable-options --doctest-compilation-args=--cfg=testcase_must_be_present
3+
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
4+
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
5+
6+
/// ```
7+
/// #[cfg(testcase_must_be_present)]
8+
/// fn must_be_present() {}
9+
///
10+
/// fn main() { must_be_present() }
11+
/// ```
12+
pub struct Bar;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
running 1 test
3+
test $DIR/rustflags.rs - Bar (line 6) ... ok
4+
5+
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
6+

0 commit comments

Comments
 (0)