@@ -147,23 +147,26 @@ impl<'test> TestCx<'test> {
147
147
assert ! ( self . revision. is_none( ) , "init_all invoked for a revision" ) ;
148
148
}
149
149
150
- fn run_cfail_test ( & self ) {
151
- let proc_res = self . compile_test ( ) ;
152
-
150
+ fn check_if_test_should_compile ( & self , proc_res : & ProcRes ) {
153
151
if self . props . must_compile_successfully {
154
152
if !proc_res. status . success ( ) {
155
- self . fatal_proc_rec ( "test compilation failed although it shouldn't!" , & proc_res) ;
153
+ self . fatal_proc_rec ( "test compilation failed although it shouldn't!" , proc_res) ;
156
154
}
157
155
} else {
158
156
if proc_res. status . success ( ) {
159
157
self . fatal_proc_rec (
160
158
& format ! ( "{} test compiled successfully!" , self . config. mode) [ ..] ,
161
- & proc_res,
159
+ proc_res,
162
160
) ;
163
161
}
164
162
165
- self . check_correct_failure_status ( & proc_res) ;
163
+ self . check_correct_failure_status ( proc_res) ;
166
164
}
165
+ }
166
+
167
+ fn run_cfail_test ( & self ) {
168
+ let proc_res = self . compile_test ( ) ;
169
+ self . check_if_test_should_compile ( & proc_res) ;
167
170
168
171
let output_to_check = self . get_output ( & proc_res) ;
169
172
let expected_errors = errors:: load_errors ( & self . testpaths . file , self . revision ) ;
@@ -2388,6 +2391,7 @@ impl<'test> TestCx<'test> {
2388
2391
. any ( |s| s. contains ( "--error-format" ) ) ;
2389
2392
2390
2393
let proc_res = self . compile_test ( ) ;
2394
+ self . check_if_test_should_compile ( & proc_res) ;
2391
2395
2392
2396
let expected_stderr_path = self . expected_output_path ( UI_STDERR ) ;
2393
2397
let expected_stderr = self . load_expected_output ( & expected_stderr_path) ;
0 commit comments