File tree Expand file tree Collapse file tree 4 files changed +75
-1
lines changed
run-make/rustdoc-should-panic Expand file tree Collapse file tree 4 files changed +75
-1
lines changed Original file line number Diff line number Diff line change 11// Ensure that `should_panic` doctests only succeed if the test actually panicked.
22// Regression test for <https://github.com/rust-lang/rust/issues/143009>.
33
4- //@ needs-target-std
4+ //@ ignore-cross-compile
55
66use run_make_support:: rustdoc;
77
Original file line number Diff line number Diff line change 1+
2+ running 7 tests
3+ test $DIR/no-run.rs - f (line 14) - compile ... ok
4+ test $DIR/no-run.rs - f (line 17) - compile ... ok
5+ test $DIR/no-run.rs - f (line 20) ... ignored
6+ test $DIR/no-run.rs - f (line 23) - compile ... ok
7+ test $DIR/no-run.rs - f (line 29) - compile fail ... ok
8+ test $DIR/no-run.rs - f (line 34) - compile ... ok
9+ test $DIR/no-run.rs - f (line 38) - compile ... ok
10+
11+ test result: ok. 6 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in $TIME
12+
Original file line number Diff line number Diff line change 1+
2+ running 5 tests
3+ test $DIR/no-run.rs - f (line 14) - compile ... ok
4+ test $DIR/no-run.rs - f (line 17) - compile ... ok
5+ test $DIR/no-run.rs - f (line 23) - compile ... ok
6+ test $DIR/no-run.rs - f (line 34) - compile ... ok
7+ test $DIR/no-run.rs - f (line 38) - compile ... ok
8+
9+ test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
10+
11+
12+ running 2 tests
13+ test $DIR/no-run.rs - f (line 20) ... ignored
14+ test $DIR/no-run.rs - f (line 29) - compile fail ... ok
15+
16+ test result: ok. 1 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in $TIME
17+
18+ all doctests ran in $TIME; merged doctests compilation took $TIME
Original file line number Diff line number Diff line change 1+ // This test ensures that the `--no-run` flag works the same between normal and merged doctests.
2+ // Regression test for <https://github.com/rust-lang/rust/issues/143858>.
3+
4+ //@ check-pass
5+ //@ revisions: edition2021 edition2024
6+ //@ [edition2021]edition:2021
7+ //@ [edition2024]edition:2024
8+ //@ compile-flags:-Z unstable-options --test --no-run --test-args=--test-threads=1
9+ //@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR"
10+ //@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
11+ //@ normalize-stdout: "ran in \d+\.\d+s" -> "ran in $$TIME"
12+ //@ normalize-stdout: "compilation took \d+\.\d+s" -> "compilation took $$TIME"
13+
14+ /// ```
15+ /// let a = true;
16+ /// ```
17+ /// ```should_panic
18+ /// panic!()
19+ /// ```
20+ /// ```ignore (incomplete-code)
21+ /// fn foo() {
22+ /// ```
23+ /// ```no_run
24+ /// loop {
25+ /// println!("Hello, world");
26+ /// }
27+ /// ```
28+ /// fails to compile
29+ /// ```compile_fail
30+ /// let x = 5;
31+ /// x += 2; // shouldn't compile!
32+ /// ```
33+ /// Ok the test does not run
34+ /// ```
35+ /// panic!()
36+ /// ```
37+ /// Ok the test does not run
38+ /// ```should_panic
39+ /// loop {
40+ /// println!("Hello, world");
41+ /// panic!()
42+ /// }
43+ /// ```
44+ pub fn f ( ) { }
You can’t perform that action at this time.
0 commit comments