@@ -2394,7 +2394,8 @@ impl<'test> TestCx<'test> {
23942394
23952395 let proc_res = new_rustdoc. document ( & compare_dir) ;
23962396 if !proc_res. status . success ( ) {
2397- proc_res. fatal ( Some ( "failed to run nightly rustdoc" ) , || ( ) ) ;
2397+ eprintln ! ( "failed to run nightly rustdoc" ) ;
2398+ return ;
23982399 }
23992400
24002401 #[ rustfmt:: skip]
@@ -2408,28 +2409,22 @@ impl<'test> TestCx<'test> {
24082409 "-modify" ,
24092410 ] ;
24102411 let tidy_dir = |dir| {
2411- let tidy = |file : & _ | {
2412- Command :: new ( "tidy" )
2413- . args ( & tidy_args)
2414- . arg ( file)
2415- . spawn ( )
2416- . unwrap_or_else ( |err| {
2417- self . fatal ( & format ! ( "failed to run tidy - is it installed? - {}" , err) )
2418- } )
2419- . wait ( )
2420- . unwrap ( )
2421- } ;
24222412 for entry in walkdir:: WalkDir :: new ( dir) {
24232413 let entry = entry. expect ( "failed to read file" ) ;
24242414 if entry. file_type ( ) . is_file ( )
24252415 && entry. path ( ) . extension ( ) . and_then ( |p| p. to_str ( ) ) == Some ( "html" . into ( ) )
24262416 {
2427- tidy ( entry. path ( ) ) ;
2417+ let status =
2418+ Command :: new ( "tidy" ) . args ( & tidy_args) . arg ( entry. path ( ) ) . status ( ) . unwrap ( ) ;
2419+ // `tidy` returns 1 if it modified the file.
2420+ assert ! ( status. success( ) || status. code( ) == Some ( 1 ) ) ;
24282421 }
24292422 }
24302423 } ;
2431- tidy_dir ( out_dir) ;
2432- tidy_dir ( & compare_dir) ;
2424+ if self . config . has_tidy {
2425+ tidy_dir ( out_dir) ;
2426+ tidy_dir ( & compare_dir) ;
2427+ }
24332428
24342429 let pager = {
24352430 let output = Command :: new ( "git" ) . args ( & [ "config" , "--get" , "core.pager" ] ) . output ( ) . ok ( ) ;
@@ -2442,7 +2437,8 @@ impl<'test> TestCx<'test> {
24422437 } )
24432438 } ;
24442439 let mut diff = Command :: new ( "diff" ) ;
2445- diff. args ( & [ "-u" , "-r" ] ) . args ( & [ & compare_dir, out_dir] ) ;
2440+ // diff recursively, showing context, and excluding .css files
2441+ diff. args ( & [ "-u" , "-r" , "-x" , "*.css" ] ) . args ( & [ & compare_dir, out_dir] ) ;
24462442
24472443 let output = if let Some ( pager) = pager {
24482444 let diff_pid = diff. stdout ( Stdio :: piped ( ) ) . spawn ( ) . expect ( "failed to run `diff`" ) ;
0 commit comments