@@ -9,7 +9,7 @@ use super::{
9
9
AllowUnused , Emit , FailMode , LinkToAux , PassMode , TargetLocation , TestCx , TestOutput ,
10
10
Truncated , UI_FIXED , WillExecute ,
11
11
} ;
12
- use crate :: { errors , json} ;
12
+ use crate :: json;
13
13
14
14
impl TestCx < ' _ > {
15
15
pub ( super ) fn run_ui_test ( & self ) {
@@ -127,9 +127,7 @@ impl TestCx<'_> {
127
127
) ;
128
128
}
129
129
130
- let expected_errors = errors:: load_errors ( & self . testpaths . file , self . revision ) ;
131
-
132
- if let WillExecute :: Yes = should_run {
130
+ let output_to_check = if let WillExecute :: Yes = should_run {
133
131
let proc_res = self . exec_compiled_test ( ) ;
134
132
let run_output_errors = if self . props . check_run_results {
135
133
self . load_compare_outputs ( & proc_res, TestOutput :: Run , explicit)
@@ -150,44 +148,19 @@ impl TestCx<'_> {
150
148
self . fatal_proc_rec ( "test run succeeded!" , & proc_res) ;
151
149
}
152
150
153
- let output_to_check = self . get_output ( & proc_res) ;
154
- if !self . props . error_patterns . is_empty ( ) || !self . props . regex_error_patterns . is_empty ( )
155
- {
156
- // "// error-pattern" comments
157
- self . check_all_error_patterns ( & output_to_check, & proc_res, pm) ;
158
- }
159
- self . check_forbid_output ( & output_to_check, & proc_res)
160
- }
151
+ self . get_output ( & proc_res)
152
+ } else {
153
+ self . get_output ( & proc_res)
154
+ } ;
161
155
162
156
debug ! (
163
- "run_ui_test: explicit={:?} config.compare_mode={:?} expected_errors={:?} \
157
+ "run_ui_test: explicit={:?} config.compare_mode={:?} \
164
158
proc_res.status={:?} props.error_patterns={:?}",
165
- explicit,
166
- self . config. compare_mode,
167
- expected_errors,
168
- proc_res. status,
169
- self . props. error_patterns
159
+ explicit, self . config. compare_mode, proc_res. status, self . props. error_patterns
170
160
) ;
171
161
172
- if !explicit && self . config . compare_mode . is_none ( ) {
173
- // "//~ERROR comments"
174
- self . check_expected_errors ( expected_errors, & proc_res) ;
175
- } else if explicit && !expected_errors. is_empty ( ) {
176
- let msg = format ! (
177
- "line {}: cannot combine `--error-format` with {} annotations; use `error-pattern` instead" ,
178
- expected_errors[ 0 ] . line_num_str( ) ,
179
- expected_errors[ 0 ] . kind,
180
- ) ;
181
- self . fatal ( & msg) ;
182
- }
183
- let output_to_check = self . get_output ( & proc_res) ;
184
- if should_run == WillExecute :: No
185
- && ( !self . props . error_patterns . is_empty ( )
186
- || !self . props . regex_error_patterns . is_empty ( ) )
187
- {
188
- // "// error-pattern" comments
189
- self . check_all_error_patterns ( & output_to_check, & proc_res, pm) ;
190
- }
162
+ self . check_expected_errors ( & proc_res) ;
163
+ self . check_all_error_patterns ( & output_to_check, & proc_res) ;
191
164
self . check_forbid_output ( & output_to_check, & proc_res) ;
192
165
193
166
if self . props . run_rustfix && self . config . compare_mode . is_none ( ) {
0 commit comments