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.
Rollup merge of rust-lang#84863 - ABouttefeux:libtest, r=m-ou-se
Show test type during prints Test output can sometimes be confusing. For example doctest with the no_run argument are displayed the same way than test that are run. During rust-lang#83857 I got the feedback that test output can be confusing. For the moment test output is ``` test $DIR/test-type.rs - f (line 12) ... ignored test $DIR/test-type.rs - f (line 15) ... ok test $DIR/test-type.rs - f (line 21) ... ok test $DIR/test-type.rs - f (line 6) ... ok ``` I propose to change output by indicating the test type as ``` test $DIR/test-type.rs - f (line 12) ... ignored test $DIR/test-type.rs - f (line 15) - compile ... ok test $DIR/test-type.rs - f (line 21) - compile fail ... ok test $DIR/test-type.rs - f (line 6) ... ok ``` by indicating the test type after the test name (and in the case of doctest after the function name and line) and before the "...". ------------ Note: this is a proof of concept, the implementation is probably not optimal as the properties added in `TestDesc` are only use in the display and does not represent actual change of behavior, maybe `TestType::DocTest` could have fields
- Loading branch information
Showing
18 changed files
with
219 additions
and
18 deletions.
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
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
|
||
running 1 test | ||
test $DIR/issue-80992.rs - test (line 7) ... ok | ||
test $DIR/issue-80992.rs - test (line 7) - compile fail ... ok | ||
|
||
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME | ||
|
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
|
||
running 7 tests | ||
test $DIR/no-run-flag.rs - f (line 11) ... ok | ||
test $DIR/no-run-flag.rs - f (line 11) - compile ... 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 $DIR/no-run-flag.rs - f (line 17) - compile ... ok | ||
test $DIR/no-run-flag.rs - f (line 23) - compile fail ... ok | ||
test $DIR/no-run-flag.rs - f (line 28) - compile ... ok | ||
test $DIR/no-run-flag.rs - f (line 32) - compile ... ok | ||
test $DIR/no-run-flag.rs - f (line 8) - compile ... ok | ||
|
||
test result: ok. 6 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in $TIME | ||
|
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,26 @@ | ||
// compile-flags: --test --test-args=--test-threads=1 | ||
// check-pass | ||
// 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! | ||
/// ``` | ||
|
||
pub fn f() {} |
Oops, something went wrong.