@@ -19,15 +19,15 @@ struct TestCase {
19
19
}
20
20
21
21
enum TestCaseCmd {
22
- Custom { func : & ' static dyn Fn ( & TestRunner ) } ,
22
+ Custom { func : & ' static dyn Fn ( & TestRunner < ' _ > ) } ,
23
23
BuildLib { source : & ' static str , crate_types : & ' static str } ,
24
24
BuildBinAndRun { source : & ' static str , args : & ' static [ & ' static str ] } ,
25
25
JitBin { source : & ' static str , args : & ' static str } ,
26
26
}
27
27
28
28
impl TestCase {
29
29
// FIXME reduce usage of custom test case commands
30
- const fn custom ( config : & ' static str , func : & ' static dyn Fn ( & TestRunner ) ) -> Self {
30
+ const fn custom ( config : & ' static str , func : & ' static dyn Fn ( & TestRunner < ' _ > ) ) -> Self {
31
31
Self { config, cmd : TestCaseCmd :: Custom { func } }
32
32
}
33
33
@@ -247,6 +247,7 @@ pub(crate) fn run_tests(
247
247
channel : & str ,
248
248
sysroot_kind : SysrootKind ,
249
249
use_unstable_features : bool ,
250
+ skip_tests : & [ & str ] ,
250
251
cg_clif_dylib : & CodegenBackend ,
251
252
bootstrap_host_compiler : & Compiler ,
252
253
rustup_toolchain_name : Option < & str > ,
@@ -256,7 +257,7 @@ pub(crate) fn run_tests(
256
257
get_default_sysroot ( & bootstrap_host_compiler. rustc ) . join ( "lib/rustlib/src/rust" ) ;
257
258
assert ! ( stdlib_source. exists( ) ) ;
258
259
259
- if config:: get_bool ( "testsuite.no_sysroot" ) {
260
+ if config:: get_bool ( "testsuite.no_sysroot" ) && !skip_tests . contains ( & "testsuite.no_sysroot" ) {
260
261
let target_compiler = build_sysroot:: build_sysroot (
261
262
dirs,
262
263
channel,
@@ -271,6 +272,7 @@ pub(crate) fn run_tests(
271
272
dirs. clone ( ) ,
272
273
target_compiler,
273
274
use_unstable_features,
275
+ skip_tests,
274
276
bootstrap_host_compiler. triple == target_triple,
275
277
stdlib_source. clone ( ) ,
276
278
) ;
@@ -281,8 +283,10 @@ pub(crate) fn run_tests(
281
283
eprintln ! ( "[SKIP] no_sysroot tests" ) ;
282
284
}
283
285
284
- let run_base_sysroot = config:: get_bool ( "testsuite.base_sysroot" ) ;
285
- let run_extended_sysroot = config:: get_bool ( "testsuite.extended_sysroot" ) ;
286
+ let run_base_sysroot = config:: get_bool ( "testsuite.base_sysroot" )
287
+ && !skip_tests. contains ( & "testsuite.base_sysroot" ) ;
288
+ let run_extended_sysroot = config:: get_bool ( "testsuite.extended_sysroot" )
289
+ && !skip_tests. contains ( & "testsuite.extended_sysroot" ) ;
286
290
287
291
if run_base_sysroot || run_extended_sysroot {
288
292
let mut target_compiler = build_sysroot:: build_sysroot (
@@ -302,6 +306,7 @@ pub(crate) fn run_tests(
302
306
dirs. clone ( ) ,
303
307
target_compiler,
304
308
use_unstable_features,
309
+ skip_tests,
305
310
bootstrap_host_compiler. triple == target_triple,
306
311
stdlib_source,
307
312
) ;
@@ -320,20 +325,22 @@ pub(crate) fn run_tests(
320
325
}
321
326
}
322
327
323
- struct TestRunner {
328
+ struct TestRunner < ' a > {
324
329
is_native : bool ,
325
330
jit_supported : bool ,
326
331
use_unstable_features : bool ,
332
+ skip_tests : & ' a [ & ' a str ] ,
327
333
dirs : Dirs ,
328
334
target_compiler : Compiler ,
329
335
stdlib_source : PathBuf ,
330
336
}
331
337
332
- impl TestRunner {
338
+ impl < ' a > TestRunner < ' a > {
333
339
fn new (
334
340
dirs : Dirs ,
335
341
mut target_compiler : Compiler ,
336
342
use_unstable_features : bool ,
343
+ skip_tests : & ' a [ & ' a str ] ,
337
344
is_native : bool ,
338
345
stdlib_source : PathBuf ,
339
346
) -> Self {
@@ -360,6 +367,7 @@ impl TestRunner {
360
367
is_native,
361
368
jit_supported,
362
369
use_unstable_features,
370
+ skip_tests,
363
371
dirs,
364
372
target_compiler,
365
373
stdlib_source,
@@ -372,7 +380,10 @@ impl TestRunner {
372
380
let tag = tag. to_uppercase ( ) ;
373
381
let is_jit_test = tag == "JIT" ;
374
382
375
- if !config:: get_bool ( config) || ( is_jit_test && !self . jit_supported ) {
383
+ if !config:: get_bool ( config)
384
+ || ( is_jit_test && !self . jit_supported )
385
+ || self . skip_tests . contains ( & config)
386
+ {
376
387
eprintln ! ( "[{tag}] {testname} (skipped)" ) ;
377
388
continue ;
378
389
} else {
0 commit comments