This commit is contained in:
Aliénore Bouttefeux 2021-04-07 17:19:11 +02:00
parent 3ad3597bd4
commit 4770446e89
2 changed files with 50 additions and 0 deletions

View 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() {}

View 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