Skip to content

Commit f79fe53

Browse files
committed
Make rust-docs component optional for local testing.
1 parent e0f9643 commit f79fe53

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

tests/testsuite/rustdoc_extern_html.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Tests for the -Zrustdoc-map feature.
22
33
use cargo_test_support::registry::Package;
4-
use cargo_test_support::{is_nightly, project, Project};
4+
use cargo_test_support::{is_nightly, paths, project, Project};
55

66
fn basic_project() -> Project {
77
Package::new("bar", "1.0.0")
@@ -78,6 +78,18 @@ fn std_docs() {
7878
// --extern-html-root-url is unstable
7979
return;
8080
}
81+
if !cargo::util::is_ci() {
82+
// For local developers, skip this test if docs aren't installed.
83+
let docs = std::path::Path::new(&paths::sysroot()).join("share/doc/rust/html");
84+
if !docs.exists() {
85+
eprintln!(
86+
"documentation not found at {}, \
87+
skipping test (run `rustdoc component add rust-docs` to install",
88+
docs.display()
89+
);
90+
return;
91+
}
92+
}
8193
let p = basic_project();
8294
p.change_file(
8395
".cargo/config",

0 commit comments

Comments
 (0)