add test
This commit is contained in:
parent
3ad3597bd4
commit
4770446e89
38
src/test/rustdoc-ui/no-run-flag.rs
Normal file
38
src/test/rustdoc-ui/no-run-flag.rs
Normal file
@ -0,0 +1,38 @@
|
||||
// test the behavior of the --no-run flag
|
||||
|
||||
// check-pass
|
||||
// compile-flags:-Z unstable-options --test --no-run --test-args=--test-threads=1
|
||||
// normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
|
||||
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||
|
||||
/// ```
|
||||
/// let a = true;
|
||||
/// ```
|
||||
/// ```should_panic
|
||||
/// panic!()
|
||||
/// ```
|
||||
/// ```ignore
|
||||
/// fn foo() {
|
||||
/// ```
|
||||
/// ```no_run
|
||||
/// loop {
|
||||
/// println!("Hello, world");
|
||||
/// }
|
||||
/// ```
|
||||
/// fails to compile
|
||||
/// ```compile_fail
|
||||
/// let x = 5;
|
||||
/// x += 2; // shouldn't compile!
|
||||
/// ```
|
||||
/// Ok the test does not run
|
||||
/// ```
|
||||
/// panic!()
|
||||
/// ```
|
||||
/// Ok the test does not run
|
||||
/// ```should_panic
|
||||
/// loop {
|
||||
/// println!("Hello, world");
|
||||
/// panic!()
|
||||
/// }
|
||||
/// ```
|
||||
pub fn f() {}
|
12
src/test/rustdoc-ui/no-run-flag.stdout
Normal file
12
src/test/rustdoc-ui/no-run-flag.stdout
Normal file
@ -0,0 +1,12 @@
|
||||
|
||||
running 7 tests
|
||||
test $DIR/no-run-flag.rs - f (line 11) ... ok
|
||||
test $DIR/no-run-flag.rs - f (line 14) ... ignored
|
||||
test $DIR/no-run-flag.rs - f (line 17) ... ok
|
||||
test $DIR/no-run-flag.rs - f (line 23) ... ok
|
||||
test $DIR/no-run-flag.rs - f (line 28) ... ok
|
||||
test $DIR/no-run-flag.rs - f (line 32) ... ok
|
||||
test $DIR/no-run-flag.rs - f (line 8) ... ok
|
||||
|
||||
test result: ok. 6 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in $TIME
|
||||
|
Loading…
x
Reference in New Issue
Block a user