@@ -14,7 +14,7 @@ use std::ffi::OsString;
14
14
use std:: fs;
15
15
use std:: io:: { self , ErrorKind } ;
16
16
use std:: path:: { Path , PathBuf } ;
17
- use std:: process:: Command ;
17
+ use std:: process:: { Command , Stdio } ;
18
18
use std:: time:: SystemTime ;
19
19
use test:: ColorConfig ;
20
20
use tracing:: * ;
@@ -43,6 +43,10 @@ fn main() {
43
43
panic ! ( "Can't find Valgrind to run Valgrind tests" ) ;
44
44
}
45
45
46
+ if !config. has_tidy && config. mode == Mode :: Rustdoc {
47
+ eprintln ! ( "warning: `tidy` is not installed; generated diffs will be harder to read" ) ;
48
+ }
49
+
46
50
log_config ( & config) ;
47
51
run_tests ( config) ;
48
52
}
@@ -189,6 +193,11 @@ pub fn parse_config(args: Vec<String>) -> Config {
189
193
190
194
let src_base = opt_path ( matches, "src-base" ) ;
191
195
let run_ignored = matches. opt_present ( "ignored" ) ;
196
+ let has_tidy = Command :: new ( "tidy" )
197
+ . arg ( "--version" )
198
+ . stdout ( Stdio :: null ( ) )
199
+ . status ( )
200
+ . map_or ( false , |status| status. success ( ) ) ;
192
201
Config {
193
202
bless : matches. opt_present ( "bless" ) ,
194
203
compile_lib_path : make_absolute ( opt_path ( matches, "compile-lib-path" ) ) ,
@@ -244,6 +253,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
244
253
remote_test_client : matches. opt_str ( "remote-test-client" ) . map ( PathBuf :: from) ,
245
254
compare_mode : matches. opt_str ( "compare-mode" ) . map ( CompareMode :: parse) ,
246
255
rustfix_coverage : matches. opt_present ( "rustfix-coverage" ) ,
256
+ has_tidy,
247
257
248
258
cc : matches. opt_str ( "cc" ) . unwrap ( ) ,
249
259
cxx : matches. opt_str ( "cxx" ) . unwrap ( ) ,
0 commit comments