Rollup merge of #96499 - jyn514:bootstrap-doctests, r=Mark-Simulacrum
Make it possible to write doctests for bootstrap This probably isn't super useful in practice, but it was easy to fix and avoids confusing errors about mismatched versions between beta and the default toolchain.
This commit is contained in:
commit
eacebb4f43
1 changed files with 11 additions and 0 deletions
|
@ -2359,6 +2359,7 @@ impl Step for Bootstrap {
|
|||
.env("RUSTFLAGS", "-Cdebuginfo=2")
|
||||
.env("CARGO_TARGET_DIR", builder.out.join("bootstrap"))
|
||||
.env("RUSTC_BOOTSTRAP", "1")
|
||||
.env("RUSTDOC", builder.rustdoc(builder.compiler(0, builder.build.build)))
|
||||
.env("RUSTC", &builder.initial_rustc);
|
||||
if let Some(flags) = option_env!("RUSTFLAGS") {
|
||||
// Use the same rustc flags for testing as for "normal" compilation,
|
||||
|
@ -2369,6 +2370,16 @@ impl Step for Bootstrap {
|
|||
if !builder.fail_fast {
|
||||
cmd.arg("--no-fail-fast");
|
||||
}
|
||||
match builder.doc_tests {
|
||||
DocTests::Only => {
|
||||
cmd.arg("--doc");
|
||||
}
|
||||
DocTests::No => {
|
||||
cmd.args(&["--lib", "--bins", "--examples", "--tests", "--benches"]);
|
||||
}
|
||||
DocTests::Yes => {}
|
||||
}
|
||||
|
||||
cmd.arg("--").args(&builder.config.cmd.test_args());
|
||||
// rustbuild tests are racy on directory creation so just run them one at a time.
|
||||
// Since there's not many this shouldn't be a problem.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue