@@ -2934,44 +2934,49 @@ impl<'test> TestCx<'test> {
2934
2934
}
2935
2935
}
2936
2936
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 {
2949
2938
let expected_stderr = self . load_expected_output ( UI_STDERR ) ;
2950
2939
let expected_stdout = self . load_expected_output ( UI_STDOUT ) ;
2951
- let expected_fixed = self . load_expected_output ( UI_FIXED ) ;
2952
2940
2953
2941
let normalized_stdout =
2954
2942
self . normalize_output ( & proc_res. stdout , & self . props . normalize_stdout ) ;
2955
2943
2956
- let stderr = if explicit {
2944
+ let stderr = if explicit_format {
2957
2945
proc_res. stderr . clone ( )
2958
2946
} else {
2959
2947
json:: extract_rendered ( & proc_res. stderr )
2960
2948
} ;
2961
2949
2962
2950
let normalized_stderr = self . normalize_output ( & stderr, & self . props . normalize_stderr ) ;
2963
-
2964
2951
let mut errors = 0 ;
2965
2952
if !self . props . dont_check_compiler_stdout {
2966
2953
errors += self . compare_output ( "stdout" , & normalized_stdout, & expected_stdout) ;
2967
2954
}
2968
2955
if !self . props . dont_check_compiler_stderr {
2969
2956
errors += self . compare_output ( "stderr" , & normalized_stderr, & expected_stderr) ;
2970
2957
}
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 ) ;
2971
2974
2972
2975
let modes_to_prune = vec ! [ CompareMode :: Nll ] ;
2973
2976
self . prune_duplicate_outputs ( & modes_to_prune) ;
2974
2977
2978
+ let mut errors = self . load_compare_outputs ( & proc_res, explicit) ;
2979
+
2975
2980
if self . config . compare_mode . is_some ( ) {
2976
2981
// don't test rustfix with nll right now
2977
2982
} else if self . config . rustfix_coverage {
0 commit comments