diff options
| author | Ralf Jung <post@ralfj.de> | 2024-03-28 22:46:07 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-03-28 22:46:25 +0100 |
| commit | fd7909aa59a761f8ba5bf34df3d84a6afa4bff1c (patch) | |
| tree | 7155be278f1a9684978ba7eae98deb86b75f5e3d /src/bootstrap | |
| parent | 929bceeaf8d3252581499ac4bc9d964d8a1a6874 (diff) | |
| download | rust-fd7909aa59a761f8ba5bf34df3d84a6afa4bff1c.tar.gz rust-fd7909aa59a761f8ba5bf34df3d84a6afa4bff1c.zip | |
x.py test miri: respect --no-doc / --doc
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/src/core/build_steps/test.rs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index 48596af7ca0..11baf0cda80 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -680,12 +680,22 @@ impl Step for Miri { .arg("--manifest-path") .arg(builder.src.join("src/tools/miri/test-cargo-miri/Cargo.toml")); cargo.arg("--target").arg(target.rustc_target_arg()); - cargo.arg("--").args(builder.config.test_args()); // `prepare_tool_cargo` sets RUSTDOC to the bootstrap wrapper and RUSTDOC_REAL to a dummy path as this is a "run", not a "test". // Also, we want the rustdoc from the "next" stage for the same reason that we build a std from the next stage. // So let's just set that here, and bypass bootstrap's RUSTDOC (just like cargo-miri already ignores bootstrap's RUSTC_WRAPPER). - cargo.env("RUSTDOC", builder.rustdoc(compiler_std)); + if builder.doc_tests != DocTests::No { + cargo.env("RUSTDOC", builder.rustdoc(compiler_std)); + } + match builder.doc_tests { + DocTests::Yes => {} + DocTests::No => { + cargo.arg("--tests"); + } + DocTests::Only => { + cargo.arg("--doc"); + } + } // Tell `cargo miri` where to find things. cargo.env("MIRI_SYSROOT", &miri_sysroot); @@ -694,6 +704,8 @@ impl Step for Miri { // Debug things. cargo.env("RUST_BACKTRACE", "1"); + // Finally, pass test-args and run everything. + cargo.arg("--").args(builder.config.test_args()); let mut cargo = Command::from(cargo); { let _time = helpers::timeit(builder); |
