Skip to content

Commit 586ed18

Browse files
authored
Rollup merge of #82502 - jyn514:tidy, r=petrochenkov
Only look for HTML `tidy` when running rustdoc tests This avoids printing lots of unnecessary errors, as well as making the test suite slightly faster. This doesn't fix the windows bug tracked by #82501, though. r? `@petrochenkov`
2 parents 8250a25 + 97ab012 commit 586ed18

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/tools/compiletest/src/main.rs

+12-6
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,17 @@ pub fn parse_config(args: Vec<String>) -> Config {
195195

196196
let src_base = opt_path(matches, "src-base");
197197
let run_ignored = matches.opt_present("ignored");
198-
let has_tidy = Command::new("tidy")
199-
.arg("--version")
200-
.stdout(Stdio::null())
201-
.status()
202-
.map_or(false, |status| status.success());
198+
let mode = matches.opt_str("mode").unwrap().parse().expect("invalid mode");
199+
let has_tidy = if mode == Mode::Rustdoc {
200+
Command::new("tidy")
201+
.arg("--version")
202+
.stdout(Stdio::null())
203+
.status()
204+
.map_or(false, |status| status.success())
205+
} else {
206+
// Avoid spawning an external command when we know tidy won't be used.
207+
false
208+
};
203209
Config {
204210
bless: matches.opt_present("bless"),
205211
compile_lib_path: make_absolute(opt_path(matches, "compile-lib-path")),
@@ -218,7 +224,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
218224
src_base,
219225
build_base: opt_path(matches, "build-base"),
220226
stage_id: matches.opt_str("stage-id").unwrap(),
221-
mode: matches.opt_str("mode").unwrap().parse().expect("invalid mode"),
227+
mode,
222228
suite: matches.opt_str("suite").unwrap(),
223229
debugger: None,
224230
run_ignored,

0 commit comments

Comments
 (0)