Add regression test for --doctest-compilation-args
This commit is contained in:
parent
05731afff2
commit
2bd869082b
2 changed files with 18 additions and 0 deletions
12
tests/rustdoc-ui/doctest/rustflags.rs
Normal file
12
tests/rustdoc-ui/doctest/rustflags.rs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
//@ check-pass
|
||||
//@ compile-flags: --test -Zunstable-options --doctest-compilation-args=--cfg=testcase_must_be_present
|
||||
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
|
||||
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||
|
||||
/// ```
|
||||
/// #[cfg(testcase_must_be_present)]
|
||||
/// fn must_be_present() {}
|
||||
///
|
||||
/// fn main() { must_be_present() }
|
||||
/// ```
|
||||
pub struct Bar;
|
||||
6
tests/rustdoc-ui/doctest/rustflags.stdout
Normal file
6
tests/rustdoc-ui/doctest/rustflags.stdout
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
running 1 test
|
||||
test $DIR/rustflags.rs - Bar (line 6) ... ok
|
||||
|
||||
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue