@@ -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) ;
@@ -353,7 +353,7 @@ impl<'test> TestCx<'test> {
353353 {
354354 self . error ( & format ! ( "{} test did not emit an error" , self . config. mode) ) ;
355355 if self . config . mode == crate :: common:: Mode :: Ui {
356- println ! ( "note: by default, ui tests are expected not to compile" ) ;
356+ eprintln ! ( "note: by default, ui tests are expected not to compile" ) ;
357357 }
358358 proc_res. fatal ( None , || ( ) ) ;
359359 } ;
@@ -774,20 +774,20 @@ impl<'test> TestCx<'test> {
774774 unexpected. len( ) ,
775775 not_found. len( )
776776 ) ) ;
777- println ! ( "status: {}\n command: {}\n " , proc_res. status, proc_res. cmdline) ;
777+ eprintln ! ( "status: {}\n command: {}\n " , proc_res. status, proc_res. cmdline) ;
778778 if !unexpected. is_empty ( ) {
779- println ! ( "{}" , "--- unexpected errors (from JSON output) ---" . green( ) ) ;
779+ eprintln ! ( "{}" , "--- unexpected errors (from JSON output) ---" . green( ) ) ;
780780 for error in & unexpected {
781- println ! ( "{}" , error. render_for_expected( ) ) ;
781+ eprintln ! ( "{}" , error. render_for_expected( ) ) ;
782782 }
783- println ! ( "{}" , "---" . green( ) ) ;
783+ eprintln ! ( "{}" , "---" . green( ) ) ;
784784 }
785785 if !not_found. is_empty ( ) {
786- println ! ( "{}" , "--- not found errors (from test file) ---" . red( ) ) ;
786+ eprintln ! ( "{}" , "--- not found errors (from test file) ---" . red( ) ) ;
787787 for error in & not_found {
788- println ! ( "{}" , error. render_for_expected( ) ) ;
788+ eprintln ! ( "{}" , error. render_for_expected( ) ) ;
789789 }
790- println ! ( "{}" , "---\n " . red( ) ) ;
790+ eprintln ! ( "{}" , "---\n " . red( ) ) ;
791791 }
792792 panic ! ( "errors differ from expected" ) ;
793793 }
@@ -1876,18 +1876,18 @@ impl<'test> TestCx<'test> {
18761876
18771877 fn maybe_dump_to_stdout ( & self , out : & str , err : & str ) {
18781878 if self . config . verbose {
1879- println ! ( "------stdout------------------------------" ) ;
1880- println ! ( "{}" , out) ;
1881- println ! ( "------stderr------------------------------" ) ;
1882- println ! ( "{}" , err) ;
1883- println ! ( "------------------------------------------" ) ;
1879+ eprintln ! ( "------stdout------------------------------" ) ;
1880+ eprintln ! ( "{}" , out) ;
1881+ eprintln ! ( "------stderr------------------------------" ) ;
1882+ eprintln ! ( "{}" , err) ;
1883+ eprintln ! ( "------------------------------------------" ) ;
18841884 }
18851885 }
18861886
18871887 fn error ( & self , err : & str ) {
18881888 match self . revision {
1889- Some ( rev) => println ! ( "\n error in revision `{}`: {}" , rev, err) ,
1890- None => println ! ( "\n error: {}" , err) ,
1889+ Some ( rev) => eprintln ! ( "\n error in revision `{}`: {}" , rev, err) ,
1890+ None => eprintln ! ( "\n error: {}" , err) ,
18911891 }
18921892 }
18931893
@@ -1972,7 +1972,7 @@ impl<'test> TestCx<'test> {
19721972 if !self . config . has_html_tidy {
19731973 return ;
19741974 }
1975- println ! ( "info: generating a diff against nightly rustdoc" ) ;
1975+ eprintln ! ( "info: generating a diff against nightly rustdoc" ) ;
19761976
19771977 let suffix =
19781978 self . safe_revision ( ) . map_or ( "nightly" . into ( ) , |path| path. to_owned ( ) + "-nightly" ) ;
@@ -2082,7 +2082,7 @@ impl<'test> TestCx<'test> {
20822082 . output ( )
20832083 . unwrap ( ) ;
20842084 assert ! ( output. status. success( ) ) ;
2085- println ! ( "{}" , String :: from_utf8_lossy( & output. stdout) ) ;
2085+ eprintln ! ( "{}" , String :: from_utf8_lossy( & output. stdout) ) ;
20862086 eprintln ! ( "{}" , String :: from_utf8_lossy( & output. stderr) ) ;
20872087 } else {
20882088 use colored:: Colorize ;
@@ -2496,7 +2496,7 @@ impl<'test> TestCx<'test> {
24962496 )"#
24972497 )
24982498 . replace_all ( & output, |caps : & Captures < ' _ > | {
2499- println ! ( "{}" , & caps[ 0 ] ) ;
2499+ eprintln ! ( "{}" , & caps[ 0 ] ) ;
25002500 caps[ 0 ] . replace ( r"\" , "/" )
25012501 } )
25022502 . replace ( "\r \n " , "\n " )
@@ -2601,14 +2601,14 @@ impl<'test> TestCx<'test> {
26012601 if let Err ( err) = fs:: write ( & actual_path, & actual) {
26022602 self . fatal ( & format ! ( "failed to write {stream} to `{actual_path:?}`: {err}" , ) ) ;
26032603 }
2604- println ! ( "Saved the actual {stream} to {actual_path:?}" ) ;
2604+ eprintln ! ( "Saved the actual {stream} to {actual_path:?}" ) ;
26052605
26062606 let expected_path =
26072607 expected_output_path ( self . testpaths , self . revision , & self . config . compare_mode , stream) ;
26082608
26092609 if !self . config . bless {
26102610 if expected. is_empty ( ) {
2611- println ! ( "normalized {}:\n {}\n " , stream, actual) ;
2611+ eprintln ! ( "normalized {}:\n {}\n " , stream, actual) ;
26122612 } else {
26132613 self . show_diff (
26142614 stream,
@@ -2631,10 +2631,10 @@ impl<'test> TestCx<'test> {
26312631 if let Err ( err) = fs:: write ( & expected_path, & actual) {
26322632 self . fatal ( & format ! ( "failed to write {stream} to `{expected_path:?}`: {err}" ) ) ;
26332633 }
2634- println ! ( "Blessing the {stream} of {test_name} in {expected_path:?}" ) ;
2634+ eprintln ! ( "Blessing the {stream} of {test_name} in {expected_path:?}" ) ;
26352635 }
26362636
2637- println ! ( "\n The actual {0} differed from the expected {0}." , stream) ;
2637+ eprintln ! ( "\n The actual {0} differed from the expected {0}." , stream) ;
26382638
26392639 if self . config . bless { 0 } else { 1 }
26402640 }
@@ -2783,7 +2783,7 @@ impl<'test> TestCx<'test> {
27832783 fs:: create_dir_all ( & incremental_dir) . unwrap ( ) ;
27842784
27852785 if self . config . verbose {
2786- println ! ( "init_incremental_test: incremental_dir={}" , incremental_dir. display( ) ) ;
2786+ eprintln ! ( "init_incremental_test: incremental_dir={}" , incremental_dir. display( ) ) ;
27872787 }
27882788 }
27892789
@@ -2841,7 +2841,7 @@ impl ProcRes {
28412841 }
28422842 }
28432843
2844- println ! (
2844+ eprintln ! (
28452845 "status: {}\n command: {}\n {}\n {}\n " ,
28462846 self . status,
28472847 self . cmdline,
@@ -2852,7 +2852,7 @@ impl ProcRes {
28522852
28532853 pub fn fatal ( & self , err : Option < & str > , on_failure : impl FnOnce ( ) ) -> ! {
28542854 if let Some ( e) = err {
2855- println ! ( "\n error: {}" , e) ;
2855+ eprintln ! ( "\n error: {}" , e) ;
28562856 }
28572857 self . print_info ( ) ;
28582858 on_failure ( ) ;
0 commit comments