@@ -14,7 +14,7 @@ use std::ffi::OsString;
1414use std:: fs;
1515use std:: io:: { self , ErrorKind } ;
1616use std:: path:: { Path , PathBuf } ;
17- use std:: process:: Command ;
17+ use std:: process:: { Command , Stdio } ;
1818use std:: time:: SystemTime ;
1919use test:: ColorConfig ;
2020use tracing:: * ;
@@ -43,6 +43,10 @@ fn main() {
4343 panic ! ( "Can't find Valgrind to run Valgrind tests" ) ;
4444 }
4545
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+
4650 log_config ( & config) ;
4751 run_tests ( config) ;
4852}
@@ -189,6 +193,11 @@ pub fn parse_config(args: Vec<String>) -> Config {
189193
190194 let src_base = opt_path ( matches, "src-base" ) ;
191195 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 ( ) ) ;
192201 Config {
193202 bless : matches. opt_present ( "bless" ) ,
194203 compile_lib_path : make_absolute ( opt_path ( matches, "compile-lib-path" ) ) ,
@@ -244,6 +253,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
244253 remote_test_client : matches. opt_str ( "remote-test-client" ) . map ( PathBuf :: from) ,
245254 compare_mode : matches. opt_str ( "compare-mode" ) . map ( CompareMode :: parse) ,
246255 rustfix_coverage : matches. opt_present ( "rustfix-coverage" ) ,
256+ has_tidy,
247257
248258 cc : matches. opt_str ( "cc" ) . unwrap ( ) ,
249259 cxx : matches. opt_str ( "cxx" ) . unwrap ( ) ,
0 commit comments