about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2021-02-25 16:06:24 -0500
committerGitHub <noreply@github.com>2021-02-25 16:06:24 -0500
commit586ed18eaf608ca05eeb0baa91b863ad74dca718 (patch)
treeae3affd5aae048dff27c02b8564d550aae6c3bdd
parent8250a2510dbbd826c0a79fbb8eca014a339ed3b9 (diff)
parent97ab01219ca224fd5410334e519df787031b8860 (diff)
downloadrust-586ed18eaf608ca05eeb0baa91b863ad74dca718.tar.gz
rust-586ed18eaf608ca05eeb0baa91b863ad74dca718.zip
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 https://github.com/rust-lang/rust/issues/82501, though.

r? `@petrochenkov`
-rw-r--r--src/tools/compiletest/src/main.rs18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs
index 5f263ea87db..b32a6f08638 100644
--- a/src/tools/compiletest/src/main.rs
+++ b/src/tools/compiletest/src/main.rs
@@ -195,11 +195,17 @@ pub fn parse_config(args: Vec<String>) -> Config {
 
     let src_base = opt_path(matches, "src-base");
     let run_ignored = matches.opt_present("ignored");
-    let has_tidy = Command::new("tidy")
-        .arg("--version")
-        .stdout(Stdio::null())
-        .status()
-        .map_or(false, |status| status.success());
+    let mode = matches.opt_str("mode").unwrap().parse().expect("invalid mode");
+    let has_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.
+        false
+    };
     Config {
         bless: matches.opt_present("bless"),
         compile_lib_path: make_absolute(opt_path(matches, "compile-lib-path")),
@@ -218,7 +224,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
         src_base,
         build_base: opt_path(matches, "build-base"),
         stage_id: matches.opt_str("stage-id").unwrap(),
-        mode: matches.opt_str("mode").unwrap().parse().expect("invalid mode"),
+        mode,
         suite: matches.opt_str("suite").unwrap(),
         debugger: None,
         run_ignored,