mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-03 10:33:34 +00:00
Don't special-case if there is only one merged doctest
This commit is contained in:
parent
72aeffa78c
commit
4b1db071d1
@ -267,9 +267,6 @@ pub(crate) fn run_tests(
|
||||
if doctests.is_empty() {
|
||||
continue;
|
||||
}
|
||||
// If there is only one mergeable doctest, the cost to run it would be higher than just
|
||||
// running it alonside standalone doctests.
|
||||
if doctests.len() > 1 {
|
||||
doctests.sort_by(|(_, a), (_, b)| a.name.cmp(&b.name));
|
||||
|
||||
let mut tests_runner = runner::DocTestRunner::new();
|
||||
@ -299,7 +296,6 @@ pub(crate) fn run_tests(
|
||||
// We failed to compile all compatible tests as one so we push them into the
|
||||
// `standalone_tests` doctests.
|
||||
debug!("Failed to compile compatible doctests for edition {} all at once", edition);
|
||||
}
|
||||
for (doctest, scraped_test) in doctests {
|
||||
doctest.generate_unique_doctest(
|
||||
&scraped_test.text,
|
||||
|
@ -1,11 +1,11 @@
|
||||
|
||||
running 1 test
|
||||
test $DIR/failed-doctest-should-panic.rs - Foo (line 9) ... FAILED
|
||||
test $DIR/failed-doctest-should-panic.rs - Foo (line 9) - should panic ... FAILED
|
||||
|
||||
failures:
|
||||
|
||||
---- $DIR/failed-doctest-should-panic.rs - Foo (line 9) stdout ----
|
||||
Test executable succeeded, but it's marked `should_panic`.
|
||||
note: test did not panic as expected
|
||||
|
||||
failures:
|
||||
$DIR/failed-doctest-should-panic.rs - Foo (line 9)
|
||||
|
@ -1,7 +1,12 @@
|
||||
|
||||
running 3 tests
|
||||
running 1 test
|
||||
test $DIR/wrong-ast-2024.rs - three (line 17) - should panic ... ok
|
||||
|
||||
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
|
||||
|
||||
|
||||
running 2 tests
|
||||
test $DIR/wrong-ast-2024.rs - one (line 7) ... FAILED
|
||||
test $DIR/wrong-ast-2024.rs - three (line 17) ... ok
|
||||
test $DIR/wrong-ast-2024.rs - two (line 12) ... FAILED
|
||||
|
||||
failures:
|
||||
@ -32,5 +37,5 @@ failures:
|
||||
$DIR/wrong-ast-2024.rs - one (line 7)
|
||||
$DIR/wrong-ast-2024.rs - two (line 12)
|
||||
|
||||
test result: FAILED. 1 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
|
||||
test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
//@ compile-flags:--test --test-args=--test-threads=1
|
||||
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
|
||||
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||
//@ normalize-stdout-test ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"
|
||||
//@ failure-status: 101
|
||||
|
||||
/// ```
|
||||
|
@ -1,14 +1,14 @@
|
||||
|
||||
running 3 tests
|
||||
test $DIR/wrong-ast.rs - one (line 7) ... FAILED
|
||||
test $DIR/wrong-ast.rs - three (line 17) ... ok
|
||||
test $DIR/wrong-ast.rs - two (line 12) ... FAILED
|
||||
test $DIR/wrong-ast.rs - one (line 6) ... FAILED
|
||||
test $DIR/wrong-ast.rs - three (line 16) ... ok
|
||||
test $DIR/wrong-ast.rs - two (line 11) ... FAILED
|
||||
|
||||
failures:
|
||||
|
||||
---- $DIR/wrong-ast.rs - one (line 7) stdout ----
|
||||
---- $DIR/wrong-ast.rs - one (line 6) stdout ----
|
||||
error[E0758]: unterminated block comment
|
||||
--> $DIR/wrong-ast.rs:$LINE:$COL
|
||||
--> $DIR/wrong-ast.rs:7:1
|
||||
|
|
||||
LL | /* plop
|
||||
| ^^^^^^^
|
||||
@ -17,9 +17,9 @@ error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0758`.
|
||||
Couldn't compile the test.
|
||||
---- $DIR/wrong-ast.rs - two (line 12) stdout ----
|
||||
---- $DIR/wrong-ast.rs - two (line 11) stdout ----
|
||||
error: unexpected closing delimiter: `}`
|
||||
--> $DIR/wrong-ast.rs:$LINE:$COL
|
||||
--> $DIR/wrong-ast.rs:12:1
|
||||
|
|
||||
LL | } mod __doctest_1 { fn main() {
|
||||
| ^ unexpected closing delimiter
|
||||
@ -29,8 +29,8 @@ error: aborting due to 1 previous error
|
||||
Couldn't compile the test.
|
||||
|
||||
failures:
|
||||
$DIR/wrong-ast.rs - one (line 7)
|
||||
$DIR/wrong-ast.rs - two (line 12)
|
||||
$DIR/wrong-ast.rs - one (line 6)
|
||||
$DIR/wrong-ast.rs - two (line 11)
|
||||
|
||||
test result: FAILED. 1 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
|
||||
|
||||
|
@ -1,17 +0,0 @@
|
||||
// This test ensures that if there is only one mergeable doctest, then it is
|
||||
// instead run as part of standalone doctests.
|
||||
|
||||
//@ compile-flags:--test --test-args=--test-threads=1 -Zunstable-options --edition 2024
|
||||
//@ normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
|
||||
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||
//@ normalize-stdout-test ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"
|
||||
//@ check-pass
|
||||
|
||||
/// ```
|
||||
/// let x = 12;
|
||||
/// ```
|
||||
///
|
||||
/// ```compile_fail
|
||||
/// let y = x;
|
||||
/// ```
|
||||
pub fn one() {}
|
@ -1,7 +0,0 @@
|
||||
|
||||
running 2 tests
|
||||
test $DIR/run-as-standalone.rs - one (line 10) ... ok
|
||||
test $DIR/run-as-standalone.rs - one (line 14) - compile fail ... ok
|
||||
|
||||
test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
|
||||
|
Loading…
Reference in New Issue
Block a user