@@ -131,7 +131,7 @@ pub fn run(config: Arc<Config>, testpaths: &TestPaths, revision: Option<&str>) {
131131
132132 if config. verbose {
133133 // We're going to be dumping a lot of info. Start on a new line.
134- print ! ( "\n \n " ) ;
134+ eprintln ! ( "\n " ) ;
135135 }
136136 debug ! ( "running {:?}" , testpaths. file. display( ) ) ;
137137 let mut props = TestProps :: from_file ( & testpaths. file , revision, & config) ;
@@ -771,20 +771,20 @@ impl<'test> TestCx<'test> {
771771 unexpected. len( ) ,
772772 not_found. len( )
773773 ) ) ;
774- println ! ( "status: {}\n command: {}\n " , proc_res. status, proc_res. cmdline) ;
774+ eprintln ! ( "status: {}\n command: {}\n " , proc_res. status, proc_res. cmdline) ;
775775 if !unexpected. is_empty ( ) {
776- println ! ( "{}" , "--- unexpected errors (from JSON output) ---" . green( ) ) ;
776+ eprintln ! ( "{}" , "--- unexpected errors (from JSON output) ---" . green( ) ) ;
777777 for error in & unexpected {
778- println ! ( "{}" , error. render_for_expected( ) ) ;
778+ eprintln ! ( "{}" , error. render_for_expected( ) ) ;
779779 }
780- println ! ( "{}" , "---" . green( ) ) ;
780+ eprintln ! ( "{}" , "---" . green( ) ) ;
781781 }
782782 if !not_found. is_empty ( ) {
783- println ! ( "{}" , "--- not found errors (from test file) ---" . red( ) ) ;
783+ eprintln ! ( "{}" , "--- not found errors (from test file) ---" . red( ) ) ;
784784 for error in & not_found {
785- println ! ( "{}" , error. render_for_expected( ) ) ;
785+ eprintln ! ( "{}" , error. render_for_expected( ) ) ;
786786 }
787- println ! ( "{}" , "---\n " . red( ) ) ;
787+ eprintln ! ( "{}" , "---\n " . red( ) ) ;
788788 }
789789 panic ! ( "errors differ from expected" ) ;
790790 }
@@ -1873,18 +1873,18 @@ impl<'test> TestCx<'test> {
18731873
18741874 fn maybe_dump_to_stdout ( & self , out : & str , err : & str ) {
18751875 if self . config . verbose {
1876- println ! ( "------stdout------------------------------" ) ;
1877- println ! ( "{}" , out) ;
1878- println ! ( "------stderr------------------------------" ) ;
1879- println ! ( "{}" , err) ;
1880- println ! ( "------------------------------------------" ) ;
1876+ eprintln ! ( "------stdout------------------------------" ) ;
1877+ eprintln ! ( "{}" , out) ;
1878+ eprintln ! ( "------stderr------------------------------" ) ;
1879+ eprintln ! ( "{}" , err) ;
1880+ eprintln ! ( "------------------------------------------" ) ;
18811881 }
18821882 }
18831883
18841884 fn error ( & self , err : & str ) {
18851885 match self . revision {
1886- Some ( rev) => println ! ( "\n error in revision `{}`: {}" , rev, err) ,
1887- None => println ! ( "\n error: {}" , err) ,
1886+ Some ( rev) => eprintln ! ( "\n error in revision `{}`: {}" , rev, err) ,
1887+ None => eprintln ! ( "\n error: {}" , err) ,
18881888 }
18891889 }
18901890
@@ -1969,7 +1969,7 @@ impl<'test> TestCx<'test> {
19691969 if !self . config . has_html_tidy {
19701970 return ;
19711971 }
1972- println ! ( "info: generating a diff against nightly rustdoc" ) ;
1972+ eprintln ! ( "info: generating a diff against nightly rustdoc" ) ;
19731973
19741974 let suffix =
19751975 self . safe_revision ( ) . map_or ( "nightly" . into ( ) , |path| path. to_owned ( ) + "-nightly" ) ;
@@ -2079,7 +2079,7 @@ impl<'test> TestCx<'test> {
20792079 . output ( )
20802080 . unwrap ( ) ;
20812081 assert ! ( output. status. success( ) ) ;
2082- println ! ( "{}" , String :: from_utf8_lossy( & output. stdout) ) ;
2082+ eprintln ! ( "{}" , String :: from_utf8_lossy( & output. stdout) ) ;
20832083 eprintln ! ( "{}" , String :: from_utf8_lossy( & output. stderr) ) ;
20842084 } else {
20852085 use colored:: Colorize ;
@@ -2479,7 +2479,7 @@ impl<'test> TestCx<'test> {
24792479 )"#
24802480 )
24812481 . replace_all ( & output, |caps : & Captures < ' _ > | {
2482- println ! ( "{}" , & caps[ 0 ] ) ;
2482+ eprintln ! ( "{}" , & caps[ 0 ] ) ;
24832483 caps[ 0 ] . replace ( r"\" , "/" )
24842484 } )
24852485 . replace ( "\r \n " , "\n " )
@@ -2578,16 +2578,16 @@ impl<'test> TestCx<'test> {
25782578 if let Err ( err) = fs:: write ( & actual_path, & actual) {
25792579 self . fatal ( & format ! ( "failed to write {stream} to `{actual_path:?}`: {err}" , ) ) ;
25802580 }
2581- println ! ( "Saved the actual {stream} to {actual_path:?}" ) ;
2581+ eprintln ! ( "Saved the actual {stream} to {actual_path:?}" ) ;
25822582
25832583 let expected_path =
25842584 expected_output_path ( self . testpaths , self . revision , & self . config . compare_mode , stream) ;
25852585
25862586 if !self . config . bless {
25872587 if expected. is_empty ( ) {
2588- println ! ( "normalized {}:\n {}\n " , stream, actual) ;
2588+ eprintln ! ( "normalized {}:\n {}\n " , stream, actual) ;
25892589 } else {
2590- println ! ( "diff of {stream}:\n " ) ;
2590+ eprintln ! ( "diff of {stream}:\n " ) ;
25912591 if let Some ( diff_command) = self . config . diff_command . as_deref ( ) {
25922592 let mut args = diff_command. split_whitespace ( ) ;
25932593 let name = args. next ( ) . unwrap ( ) ;
@@ -2603,11 +2603,11 @@ impl<'test> TestCx<'test> {
26032603 }
26042604 Ok ( output) => {
26052605 let output = String :: from_utf8_lossy ( & output. stdout ) ;
2606- print ! ( "{output}" ) ;
2606+ eprint ! ( "{output}" ) ;
26072607 }
26082608 }
26092609 } else {
2610- print ! ( "{}" , write_diff( expected, actual, 3 ) ) ;
2610+ eprint ! ( "{}" , write_diff( expected, actual, 3 ) ) ;
26112611 }
26122612 }
26132613 } else {
@@ -2622,10 +2622,10 @@ impl<'test> TestCx<'test> {
26222622 if let Err ( err) = fs:: write ( & expected_path, & actual) {
26232623 self . fatal ( & format ! ( "failed to write {stream} to `{expected_path:?}`: {err}" ) ) ;
26242624 }
2625- println ! ( "Blessing the {stream} of {test_name} in {expected_path:?}" ) ;
2625+ eprintln ! ( "Blessing the {stream} of {test_name} in {expected_path:?}" ) ;
26262626 }
26272627
2628- println ! ( "\n The actual {0} differed from the expected {0}." , stream) ;
2628+ eprintln ! ( "\n The actual {0} differed from the expected {0}." , stream) ;
26292629
26302630 if self . config . bless { 0 } else { 1 }
26312631 }
@@ -2704,7 +2704,7 @@ impl<'test> TestCx<'test> {
27042704 fs:: create_dir_all ( & incremental_dir) . unwrap ( ) ;
27052705
27062706 if self . config . verbose {
2707- println ! ( "init_incremental_test: incremental_dir={}" , incremental_dir. display( ) ) ;
2707+ eprintln ! ( "init_incremental_test: incremental_dir={}" , incremental_dir. display( ) ) ;
27082708 }
27092709 }
27102710
@@ -2762,7 +2762,7 @@ impl ProcRes {
27622762 }
27632763 }
27642764
2765- println ! (
2765+ eprintln ! (
27662766 "status: {}\n command: {}\n {}\n {}\n " ,
27672767 self . status,
27682768 self . cmdline,
@@ -2773,7 +2773,7 @@ impl ProcRes {
27732773
27742774 pub fn fatal ( & self , err : Option < & str > , on_failure : impl FnOnce ( ) ) -> ! {
27752775 if let Some ( e) = err {
2776- println ! ( "\n error: {}" , e) ;
2776+ eprintln ! ( "\n error: {}" , e) ;
27772777 }
27782778 self . print_info ( ) ;
27792779 on_failure ( ) ;
0 commit comments