File tree 1 file changed +19
-15
lines changed
src/tools/compiletest/src
1 file changed +19
-15
lines changed Original file line number Diff line number Diff line change @@ -3753,23 +3753,27 @@ pub struct ProcRes {
3753
3753
3754
3754
impl ProcRes {
3755
3755
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 " ,
3769
3773
self . status,
3770
3774
self . cmdline,
3771
- json :: extract_rendered ( & self . stdout) ,
3772
- json :: extract_rendered ( & self . stderr) ,
3775
+ render ( "stdout" , & self . stdout) ,
3776
+ render ( "stderr" , & self . stderr) ,
3773
3777
) ;
3774
3778
}
3775
3779
You can’t perform that action at this time.
0 commit comments