diff options
| author | 许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com> | 2024-10-20 11:36:46 +0800 |
|---|---|---|
| committer | 许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com> | 2024-10-20 14:30:52 +0800 |
| commit | e32a5be3b0beb84a32b952e91b3acc5f14c1d40b (patch) | |
| tree | b5d34a3e31606a66cb5d0d6a325e42d676fa22de | |
| parent | d68c32779627fcd72a928c9e89f65094dbcf7482 (diff) | |
| download | rust-e32a5be3b0beb84a32b952e91b3acc5f14c1d40b.tar.gz rust-e32a5be3b0beb84a32b952e91b3acc5f14c1d40b.zip | |
compiletest: disambiguate between `tidy` and `tidy` (html version)
| -rw-r--r-- | src/tools/compiletest/src/common.rs | 4 | ||||
| -rw-r--r-- | src/tools/compiletest/src/lib.rs | 6 | ||||
| -rw-r--r-- | src/tools/compiletest/src/main.rs | 2 | ||||
| -rw-r--r-- | src/tools/compiletest/src/runtest.rs | 4 |
4 files changed, 7 insertions, 9 deletions
diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs index 1ee00a3a4e8..ff059940f7c 100644 --- a/src/tools/compiletest/src/common.rs +++ b/src/tools/compiletest/src/common.rs @@ -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, diff --git a/src/tools/compiletest/src/lib.rs b/src/tools/compiletest/src/lib.rs index d045c6fe053..7d6ede9bcda 100644 --- a/src/tools/compiletest/src/lib.rs +++ b/src/tools/compiletest/src/lib.rs @@ -230,14 +230,14 @@ pub fn parse_config(args: Vec<String>) -> Config { 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 @@ pub fn parse_config(args: Vec<String>) -> Config { .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"), diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs index b84dd956de0..2f0c7d8ddc5 100644 --- a/src/tools/compiletest/src/main.rs +++ b/src/tools/compiletest/src/main.rs @@ -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"); } diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 5b8a96a54c2..36c5106ddad 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -1,5 +1,3 @@ -// ignore-tidy-filelength - use std::borrow::Cow; use std::collections::{HashMap, HashSet}; use std::ffi::OsString; @@ -1897,7 +1895,7 @@ impl<'test> TestCx<'test> { } 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"); |
