about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2022-05-02 10:41:56 +0900
committerGitHub <noreply@github.com>2022-05-02 10:41:56 +0900
commiteacebb4f4374c77843c31d57d7226efeae2f56a6 (patch)
treeab2c9aa15ab7887505e13e6a8d5b2086a0cb5b20
parent1785f1549cec9eb7947e204d6146c20b2410c40d (diff)
parent2f287d6a3e200197919e5372ac74abb66ce038ad (diff)
downloadrust-eacebb4f4374c77843c31d57d7226efeae2f56a6.tar.gz
rust-eacebb4f4374c77843c31d57d7226efeae2f56a6.zip
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.
-rw-r--r--src/bootstrap/test.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
index 1193546992c..4dfc02dea46 100644
--- a/src/bootstrap/test.rs
+++ b/src/bootstrap/test.rs
@@ -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.