1- use super :: { FailMode , TestCx , WillExecute } ;
2- use crate :: errors;
1+ use super :: { FailMode , ProcRes , TestCx , WillExecute } ;
32
43impl TestCx < ' _ > {
54 pub ( super ) fn run_incremental_test ( & self ) {
@@ -57,10 +56,7 @@ impl TestCx<'_> {
5756 self . fatal_proc_rec ( "compilation failed!" , & proc_res) ;
5857 }
5958
60- // FIXME(#41968): Move this check to tidy?
61- if !errors:: load_errors ( & self . testpaths . file , self . revision ) . is_empty ( ) {
62- self . fatal ( "build-pass tests with expected warnings should be moved to ui/" ) ;
63- }
59+ self . check_compiler_output_for_incr ( & proc_res) ;
6460 }
6561
6662 fn run_rpass_test ( & self ) {
@@ -72,10 +68,7 @@ impl TestCx<'_> {
7268 self . fatal_proc_rec ( "compilation failed!" , & proc_res) ;
7369 }
7470
75- // FIXME(#41968): Move this check to tidy?
76- if !errors:: load_errors ( & self . testpaths . file , self . revision ) . is_empty ( ) {
77- self . fatal ( "run-pass tests with expected warnings should be moved to ui/" ) ;
78- }
71+ self . check_compiler_output_for_incr ( & proc_res) ;
7972
8073 if let WillExecute :: Disabled = should_run {
8174 return ;
@@ -93,16 +86,20 @@ impl TestCx<'_> {
9386 self . check_if_test_should_compile ( Some ( FailMode :: Build ) , pm, & proc_res) ;
9487 self . check_no_compiler_crash ( & proc_res, self . props . should_ice ) ;
9588
96- let output_to_check = self . get_output ( & proc_res) ;
97- self . check_expected_errors ( & proc_res) ;
98- self . check_all_error_patterns ( & output_to_check, & proc_res) ;
89+ self . check_compiler_output_for_incr ( & proc_res) ;
90+
9991 if self . props . should_ice {
10092 match proc_res. status . code ( ) {
10193 Some ( 101 ) => ( ) ,
10294 _ => self . fatal ( "expected ICE" ) ,
10395 }
10496 }
97+ }
10598
106- self . check_forbid_output ( & output_to_check, & proc_res) ;
99+ fn check_compiler_output_for_incr ( & self , proc_res : & ProcRes ) {
100+ let output_to_check = self . get_output ( proc_res) ;
101+ self . check_expected_errors ( & proc_res) ;
102+ self . check_all_error_patterns ( & output_to_check, proc_res) ;
103+ self . check_forbid_output ( & output_to_check, proc_res) ;
107104 }
108105}
0 commit comments