x.py test miri: respect --no-doc / --doc
This commit is contained in:
parent
929bceeaf8
commit
fd7909aa59
@ -680,12 +680,22 @@ impl Step for Miri {
|
|||||||
.arg("--manifest-path")
|
.arg("--manifest-path")
|
||||||
.arg(builder.src.join("src/tools/miri/test-cargo-miri/Cargo.toml"));
|
.arg(builder.src.join("src/tools/miri/test-cargo-miri/Cargo.toml"));
|
||||||
cargo.arg("--target").arg(target.rustc_target_arg());
|
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".
|
// `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.
|
// 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).
|
// So let's just set that here, and bypass bootstrap's RUSTDOC (just like cargo-miri already ignores bootstrap's RUSTC_WRAPPER).
|
||||||
|
if builder.doc_tests != DocTests::No {
|
||||||
cargo.env("RUSTDOC", builder.rustdoc(compiler_std));
|
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.
|
// Tell `cargo miri` where to find things.
|
||||||
cargo.env("MIRI_SYSROOT", &miri_sysroot);
|
cargo.env("MIRI_SYSROOT", &miri_sysroot);
|
||||||
@ -694,6 +704,8 @@ impl Step for Miri {
|
|||||||
// Debug things.
|
// Debug things.
|
||||||
cargo.env("RUST_BACKTRACE", "1");
|
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 mut cargo = Command::from(cargo);
|
||||||
{
|
{
|
||||||
let _time = helpers::timeit(builder);
|
let _time = helpers::timeit(builder);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user