Skip to content

Commit 2515d15

Browse files
authored
Rollup merge of rust-lang#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 rust-lang#131941. Also apparently `runtest.rs` is short enough now, we can delete the `tidy` (bootstrap version) ignore for file length.
2 parents 4aaa2ea + e32a5be commit 2515d15

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

src/tools/compiletest/src/common.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,8 @@ pub struct Config {
338338
/// created in `/<build_base>/rustfix_missing_coverage.txt`
339339
pub rustfix_coverage: bool,
340340

341-
/// whether to run `tidy` when a rustdoc test fails
342-
pub has_tidy: bool,
341+
/// whether to run `tidy` (html-tidy) when a rustdoc test fails
342+
pub has_html_tidy: bool,
343343

344344
/// whether to run `enzyme` autodiff tests
345345
pub has_enzyme: bool,

src/tools/compiletest/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,14 @@ pub fn parse_config(args: Vec<String>) -> Config {
230230
let run_ignored = matches.opt_present("ignored");
231231
let with_debug_assertions = matches.opt_present("with-debug-assertions");
232232
let mode = matches.opt_str("mode").unwrap().parse().expect("invalid mode");
233-
let has_tidy = if mode == Mode::Rustdoc {
233+
let has_html_tidy = if mode == Mode::Rustdoc {
234234
Command::new("tidy")
235235
.arg("--version")
236236
.stdout(Stdio::null())
237237
.status()
238238
.map_or(false, |status| status.success())
239239
} else {
240-
// Avoid spawning an external command when we know tidy won't be used.
240+
// Avoid spawning an external command when we know html-tidy won't be used.
241241
false
242242
};
243243
let has_enzyme = matches.opt_present("has-enzyme");
@@ -336,7 +336,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
336336
.opt_str("compare-mode")
337337
.map(|s| s.parse().expect("invalid --compare-mode provided")),
338338
rustfix_coverage: matches.opt_present("rustfix-coverage"),
339-
has_tidy,
339+
has_html_tidy,
340340
has_enzyme,
341341
channel: matches.opt_str("channel").unwrap(),
342342
git_hash: matches.opt_present("git-hash"),

src/tools/compiletest/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fn main() {
1818

1919
let config = Arc::new(parse_config(env::args().collect()));
2020

21-
if !config.has_tidy && config.mode == Mode::Rustdoc {
21+
if !config.has_html_tidy && config.mode == Mode::Rustdoc {
2222
eprintln!("warning: `tidy` (html-tidy.org) is not installed; diffs will not be generated");
2323
}
2424

src/tools/compiletest/src/runtest.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// ignore-tidy-filelength
2-
31
use std::borrow::Cow;
42
use std::collections::{HashMap, HashSet};
53
use std::ffi::OsString;
@@ -1897,7 +1895,7 @@ impl<'test> TestCx<'test> {
18971895
}
18981896

18991897
fn compare_to_default_rustdoc(&mut self, out_dir: &Path) {
1900-
if !self.config.has_tidy {
1898+
if !self.config.has_html_tidy {
19011899
return;
19021900
}
19031901
println!("info: generating a diff against nightly rustdoc");

0 commit comments

Comments
 (0)