forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#83857 - ABouttefeux:master, r=jyn514
added --no-run option for rustdoc resolve rust-lang#59053 add `--no-run` option for `rustdoc` for compiling doc test but not running them. Intended for use with `--persist-doctests`.
- Loading branch information
Showing
7 changed files
with
71 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// test the behavior of the --no-run flag without the --test flag | ||
|
||
// compile-flags:-Z unstable-options --no-run --test-args=--test-threads=1 | ||
// error-pattern: the `--test` flag must be passed | ||
|
||
pub fn f() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
error: the `--test` flag must be passed to enable `--no-run` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 (incomplete-code) | ||
/// 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() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|