Skip to content

Commit

Permalink
Fix x test src/librustdoc --no-doc
Browse files Browse the repository at this point in the history
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'
```
  • Loading branch information
jyn514 committed Mar 27, 2022
1 parent 1d24c2e commit 26cc0be
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down

0 comments on commit 26cc0be

Please sign in to comment.