@@ -100,7 +100,14 @@ fn get_lib_name(lib: &str, aux_type: AuxType) -> Option<String> {
100
100
}
101
101
}
102
102
103
- pub fn run ( config : Arc < Config > , testpaths : & TestPaths , revision : Option < & str > ) {
103
+ pub fn run (
104
+ config : Arc < Config > ,
105
+ testpaths : & TestPaths ,
106
+ revision : Option < & str > ,
107
+ all_revisions : & [ Option < String > ] ,
108
+ ) {
109
+ let all_revisions_refs: Vec < _ > = all_revisions. iter ( ) . map ( Option :: as_deref) . collect ( ) ;
110
+ let all_revisions = & all_revisions_refs;
104
111
match & * config. target {
105
112
"arm-linux-androideabi"
106
113
| "armv7-linux-androideabi"
@@ -133,7 +140,7 @@ pub fn run(config: Arc<Config>, testpaths: &TestPaths, revision: Option<&str>) {
133
140
props. incremental_dir = Some ( incremental_dir ( & config, testpaths, revision) ) ;
134
141
}
135
142
136
- let cx = TestCx { config : & config, props : & props, testpaths, revision } ;
143
+ let cx = TestCx { config : & config, props : & props, testpaths, revision, all_revisions } ;
137
144
create_dir_all ( & cx. output_base_dir ( ) )
138
145
. with_context ( || {
139
146
format ! ( "failed to create output base directory {}" , cx. output_base_dir( ) . display( ) )
@@ -155,6 +162,7 @@ pub fn run(config: Arc<Config>, testpaths: &TestPaths, revision: Option<&str>) {
155
162
props : & revision_props,
156
163
testpaths,
157
164
revision : Some ( revision) ,
165
+ all_revisions,
158
166
} ;
159
167
rev_cx. run_revision ( ) ;
160
168
}
@@ -209,6 +217,8 @@ struct TestCx<'test> {
209
217
props : & ' test TestProps ,
210
218
testpaths : & ' test TestPaths ,
211
219
revision : Option < & ' test str > ,
220
+ /// List of all revisions for the test, so we can reject any that are unexpected
221
+ all_revisions : & ' test [ Option < & ' test str > ] ,
212
222
}
213
223
214
224
enum ReadFrom {
@@ -339,7 +349,8 @@ impl<'test> TestCx<'test> {
339
349
self . check_no_compiler_crash ( & proc_res, self . props . should_ice ) ;
340
350
341
351
let output_to_check = self . get_output ( & proc_res) ;
342
- let expected_errors = errors:: load_errors ( & self . testpaths . file , self . revision ) ;
352
+ let expected_errors =
353
+ errors:: load_errors ( & self . testpaths . file , self . revision , self . all_revisions ) ;
343
354
if !expected_errors. is_empty ( ) {
344
355
if !self . props . error_patterns . is_empty ( ) || !self . props . regex_error_patterns . is_empty ( )
345
356
{
@@ -417,7 +428,8 @@ impl<'test> TestCx<'test> {
417
428
}
418
429
419
430
// FIXME(#41968): Move this check to tidy?
420
- if !errors:: load_errors ( & self . testpaths . file , self . revision ) . is_empty ( ) {
431
+ if !errors:: load_errors ( & self . testpaths . file , self . revision , self . all_revisions ) . is_empty ( )
432
+ {
421
433
self . fatal ( "compile-pass tests with expected warnings should be moved to ui/" ) ;
422
434
}
423
435
}
@@ -432,7 +444,8 @@ impl<'test> TestCx<'test> {
432
444
}
433
445
434
446
// FIXME(#41968): Move this check to tidy?
435
- if !errors:: load_errors ( & self . testpaths . file , self . revision ) . is_empty ( ) {
447
+ if !errors:: load_errors ( & self . testpaths . file , self . revision , self . all_revisions ) . is_empty ( )
448
+ {
436
449
self . fatal ( "run-pass tests with expected warnings should be moved to ui/" ) ;
437
450
}
438
451
@@ -1922,6 +1935,7 @@ impl<'test> TestCx<'test> {
1922
1935
props : & aux_props,
1923
1936
testpaths : & aux_testpaths,
1924
1937
revision : self . revision ,
1938
+ all_revisions : self . all_revisions ,
1925
1939
} ;
1926
1940
// Create the directory for the stdout/stderr files.
1927
1941
create_dir_all ( aux_cx. output_base_dir ( ) ) . unwrap ( ) ;
@@ -2183,6 +2197,7 @@ impl<'test> TestCx<'test> {
2183
2197
props : & aux_props,
2184
2198
testpaths : & aux_testpaths,
2185
2199
revision : self . revision ,
2200
+ all_revisions : self . all_revisions ,
2186
2201
} ;
2187
2202
// Create the directory for the stdout/stderr files.
2188
2203
create_dir_all ( aux_cx. output_base_dir ( ) ) . unwrap ( ) ;
@@ -3318,7 +3333,7 @@ impl<'test> TestCx<'test> {
3318
3333
. map ( |line| str_to_mono_item ( line, true ) )
3319
3334
. collect ( ) ;
3320
3335
3321
- let expected: Vec < MonoItem > = errors:: load_errors ( & self . testpaths . file , None )
3336
+ let expected: Vec < MonoItem > = errors:: load_errors ( & self . testpaths . file , None , & [ ] )
3322
3337
. iter ( )
3323
3338
. map ( |e| str_to_mono_item ( & e. msg [ ..] , false ) )
3324
3339
. collect ( ) ;
@@ -4207,7 +4222,8 @@ impl<'test> TestCx<'test> {
4207
4222
) ;
4208
4223
}
4209
4224
4210
- let expected_errors = errors:: load_errors ( & self . testpaths . file , self . revision ) ;
4225
+ let expected_errors =
4226
+ errors:: load_errors ( & self . testpaths . file , self . revision , self . all_revisions ) ;
4211
4227
4212
4228
if let WillExecute :: Yes = should_run {
4213
4229
let proc_res = self . exec_compiled_test ( ) ;
0 commit comments