about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJoshua Nelson <jnelson@cloudflare.com>2022-03-27 09:13:04 -0500
committerJoshua Nelson <jnelson@cloudflare.com>2022-03-27 09:21:50 -0500
commit26cc0be248b2f013f96bf47ccc24f99e4424c991 (patch)
treeb3c4a308f9adae3226e6710f8ecbf758da5fb906
parent1d24c2eeb1ea5c723722b2c8543ecb50a53b2c96 (diff)
downloadrust-26cc0be248b2f013f96bf47ccc24f99e4424c991.tar.gz
rust-26cc0be248b2f013f96bf47ccc24f99e4424c991.zip
Fix `x test src/librustdoc --no-doc`
Previously, it would erroneously try to run the doc-tests anyway and give an error:
```
   Doc-tests rustdoc
thread 'main' panicked at 'RUSTDOC_LIBDIR was not set', src/bootstrap/bin/rustdoc.rs:15:48
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: test failed, to rerun pass '--doc'
```
-rw-r--r--src/bootstrap/test.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
index 8ed1ad3678e..a8c511ea693 100644
--- a/src/bootstrap/test.rs
+++ b/src/bootstrap/test.rs
@@ -2118,6 +2118,15 @@ impl Step for CrateRustdoc {
         if test_kind.subcommand() == "test" && !builder.fail_fast {
             cargo.arg("--no-fail-fast");
         }
+        match builder.doc_tests {
+            DocTests::Only => {
+                cargo.arg("--doc");
+            }
+            DocTests::No => {
+                cargo.args(&["--lib", "--bins", "--examples", "--tests", "--benches"]);
+            }
+            DocTests::Yes => {}
+        }
 
         cargo.arg("-p").arg("rustdoc:0.0.0");