Rollup merge of #83228 - GuillaumeGomez:no-diff-if-no-tidy, r=jyn514

Don't show HTML diff if tidy isn't installed for rustdoc tests

The output without the `tidy` tool is just way too big to be of any use. It makes reading the error much more complicated.

r? ``@jyn514``
This commit is contained in:
Dylan DPC 2021-03-18 00:28:16 +01:00 committed by GitHub
commit 22a9582ca2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -44,7 +44,7 @@ fn main() {
}
if !config.has_tidy && config.mode == Mode::Rustdoc {
eprintln!("warning: `tidy` is not installed; generated diffs will be harder to read");
eprintln!("warning: `tidy` is not installed; diffs will not be generated");
}
log_config(&config);

View File

@ -2367,6 +2367,9 @@ impl<'test> TestCx<'test> {
}
fn compare_to_default_rustdoc(&mut self, out_dir: &Path) {
if !self.config.has_tidy {
return;
}
println!("info: generating a diff against nightly rustdoc");
let suffix =
@ -2428,10 +2431,8 @@ impl<'test> TestCx<'test> {
}
}
};
if self.config.has_tidy {
tidy_dir(out_dir);
tidy_dir(&compare_dir);
}
tidy_dir(out_dir);
tidy_dir(&compare_dir);
let pager = {
let output = Command::new("git").args(&["config", "--get", "core.pager"]).output().ok();