mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
Make rust-docs component optional for local testing.
This commit is contained in:
parent
e0f9643b0f
commit
f79fe537ba
@ -1,7 +1,7 @@
|
||||
//! Tests for the -Zrustdoc-map feature.
|
||||
|
||||
use cargo_test_support::registry::Package;
|
||||
use cargo_test_support::{is_nightly, project, Project};
|
||||
use cargo_test_support::{is_nightly, paths, project, Project};
|
||||
|
||||
fn basic_project() -> Project {
|
||||
Package::new("bar", "1.0.0")
|
||||
@ -78,6 +78,18 @@ fn std_docs() {
|
||||
// --extern-html-root-url is unstable
|
||||
return;
|
||||
}
|
||||
if !cargo::util::is_ci() {
|
||||
// For local developers, skip this test if docs aren't installed.
|
||||
let docs = std::path::Path::new(&paths::sysroot()).join("share/doc/rust/html");
|
||||
if !docs.exists() {
|
||||
eprintln!(
|
||||
"documentation not found at {}, \
|
||||
skipping test (run `rustdoc component add rust-docs` to install",
|
||||
docs.display()
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
let p = basic_project();
|
||||
p.change_file(
|
||||
".cargo/config",
|
||||
|
Loading…
x
Reference in New Issue
Block a user