File tree Expand file tree Collapse file tree 1 file changed +19
-15
lines changed
src/tools/compiletest/src Expand file tree Collapse file tree 1 file changed +19
-15
lines changed Original file line number Diff line number Diff line change @@ -3753,23 +3753,27 @@ pub struct ProcRes {
37533753
37543754impl ProcRes {
37553755 pub fn print_info ( & self ) {
3756- print ! (
3757- "\
3758- status: {}\n \
3759- command: {}\n \
3760- stdout:\n \
3761- ------------------------------------------\n \
3762- {}\n \
3763- ------------------------------------------\n \
3764- stderr:\n \
3765- ------------------------------------------\n \
3766- {}\n \
3767- ------------------------------------------\n \
3768- \n ",
3756+ fn render ( name : & str , contents : & str ) -> String {
3757+ let contents = json:: extract_rendered ( contents) ;
3758+ let contents = contents. trim ( ) ;
3759+ if contents. is_empty ( ) {
3760+ format ! ( "{name}: none" )
3761+ } else {
3762+ format ! (
3763+ "\
3764+ --- {name} -------------------------------\n \
3765+ {contents}\n \
3766+ ------------------------------------------",
3767+ )
3768+ }
3769+ }
3770+
3771+ println ! (
3772+ "status: {}\n command: {}\n {}\n {}\n " ,
37693773 self . status,
37703774 self . cmdline,
3771- json :: extract_rendered ( & self . stdout) ,
3772- json :: extract_rendered ( & self . stderr) ,
3775+ render ( "stdout" , & self . stdout) ,
3776+ render ( "stderr" , & self . stderr) ,
37733777 ) ;
37743778 }
37753779
You can’t perform that action at this time.
0 commit comments