Rollup merge of #131961 - jieyouxu:dirty, r=Zalathar

compiletest: tidy up how `tidy` and `tidy` (html version) are disambiguated

Rename `has_tidy` -> `has_html_tidy` (`tidy` is also a bootstrap tool, but rustdoc uses a html tidy that has the same binary name). Follow-up to #131941.

Also apparently `runtest.rs` is short enough now, we can delete the `tidy` (bootstrap version) ignore for file length.
This commit is contained in:
Matthias Krüger 2024-10-20 16:54:11 +02:00 committed by GitHub
commit 0d4cf0521e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 9 deletions

View File

@ -338,8 +338,8 @@ pub struct Config {
/// created in `/<build_base>/rustfix_missing_coverage.txt`
pub rustfix_coverage: bool,
/// whether to run `tidy` when a rustdoc test fails
pub has_tidy: bool,
/// whether to run `tidy` (html-tidy) when a rustdoc test fails
pub has_html_tidy: bool,
/// whether to run `enzyme` autodiff tests
pub has_enzyme: bool,

View File

@ -230,14 +230,14 @@ fn make_absolute(path: PathBuf) -> PathBuf {
let run_ignored = matches.opt_present("ignored");
let with_debug_assertions = matches.opt_present("with-debug-assertions");
let mode = matches.opt_str("mode").unwrap().parse().expect("invalid mode");
let has_tidy = if mode == Mode::Rustdoc {
let has_html_tidy = if mode == Mode::Rustdoc {
Command::new("tidy")
.arg("--version")
.stdout(Stdio::null())
.status()
.map_or(false, |status| status.success())
} else {
// Avoid spawning an external command when we know tidy won't be used.
// Avoid spawning an external command when we know html-tidy won't be used.
false
};
let has_enzyme = matches.opt_present("has-enzyme");
@ -336,7 +336,7 @@ fn make_absolute(path: PathBuf) -> PathBuf {
.opt_str("compare-mode")
.map(|s| s.parse().expect("invalid --compare-mode provided")),
rustfix_coverage: matches.opt_present("rustfix-coverage"),
has_tidy,
has_html_tidy,
has_enzyme,
channel: matches.opt_str("channel").unwrap(),
git_hash: matches.opt_present("git-hash"),

View File

@ -18,7 +18,7 @@ fn main() {
let config = Arc::new(parse_config(env::args().collect()));
if !config.has_tidy && config.mode == Mode::Rustdoc {
if !config.has_html_tidy && config.mode == Mode::Rustdoc {
eprintln!("warning: `tidy` (html-tidy.org) is not installed; diffs will not be generated");
}

View File

@ -1,5 +1,3 @@
// ignore-tidy-filelength
use std::borrow::Cow;
use std::collections::{HashMap, HashSet};
use std::ffi::OsString;
@ -1897,7 +1895,7 @@ fn charset() -> &'static str {
}
fn compare_to_default_rustdoc(&mut self, out_dir: &Path) {
if !self.config.has_tidy {
if !self.config.has_html_tidy {
return;
}
println!("info: generating a diff against nightly rustdoc");