@@ -2934,44 +2934,49 @@ impl<'test> TestCx<'test> {
29342934 }
29352935 }
29362936
2937- fn run_ui_test ( & self ) {
2938- // if the user specified a format in the ui test
2939- // print the output to the stderr file, otherwise extract
2940- // the rendered error messages from json and print them
2941- let explicit = self
2942- . props
2943- . compile_flags
2944- . iter ( )
2945- . any ( |s| s. contains ( "--error-format" ) ) ;
2946- let proc_res = self . compile_test ( ) ;
2947- self . check_if_test_should_compile ( & proc_res) ;
2948-
2937+ fn load_compare_outputs ( & self , proc_res : & ProcRes , explicit_format : bool ) -> usize {
29492938 let expected_stderr = self . load_expected_output ( UI_STDERR ) ;
29502939 let expected_stdout = self . load_expected_output ( UI_STDOUT ) ;
2951- let expected_fixed = self . load_expected_output ( UI_FIXED ) ;
29522940
29532941 let normalized_stdout =
29542942 self . normalize_output ( & proc_res. stdout , & self . props . normalize_stdout ) ;
29552943
2956- let stderr = if explicit {
2944+ let stderr = if explicit_format {
29572945 proc_res. stderr . clone ( )
29582946 } else {
29592947 json:: extract_rendered ( & proc_res. stderr )
29602948 } ;
29612949
29622950 let normalized_stderr = self . normalize_output ( & stderr, & self . props . normalize_stderr ) ;
2963-
29642951 let mut errors = 0 ;
29652952 if !self . props . dont_check_compiler_stdout {
29662953 errors += self . compare_output ( "stdout" , & normalized_stdout, & expected_stdout) ;
29672954 }
29682955 if !self . props . dont_check_compiler_stderr {
29692956 errors += self . compare_output ( "stderr" , & normalized_stderr, & expected_stderr) ;
29702957 }
2958+ errors
2959+ }
2960+
2961+ fn run_ui_test ( & self ) {
2962+ // if the user specified a format in the ui test
2963+ // print the output to the stderr file, otherwise extract
2964+ // the rendered error messages from json and print them
2965+ let explicit = self
2966+ . props
2967+ . compile_flags
2968+ . iter ( )
2969+ . any ( |s| s. contains ( "--error-format" ) ) ;
2970+ let proc_res = self . compile_test ( ) ;
2971+ self . check_if_test_should_compile ( & proc_res) ;
2972+
2973+ let expected_fixed = self . load_expected_output ( UI_FIXED ) ;
29712974
29722975 let modes_to_prune = vec ! [ CompareMode :: Nll ] ;
29732976 self . prune_duplicate_outputs ( & modes_to_prune) ;
29742977
2978+ let mut errors = self . load_compare_outputs ( & proc_res, explicit) ;
2979+
29752980 if self . config . compare_mode . is_some ( ) {
29762981 // don't test rustfix with nll right now
29772982 } else if self . config . rustfix_coverage {
0 commit comments