@@ -19,15 +19,15 @@ struct TestCase {
1919}
2020
2121enum TestCaseCmd {
22- Custom { func : & ' static dyn Fn ( & TestRunner ) } ,
22+ Custom { func : & ' static dyn Fn ( & TestRunner < ' _ > ) } ,
2323 BuildLib { source : & ' static str , crate_types : & ' static str } ,
2424 BuildBinAndRun { source : & ' static str , args : & ' static [ & ' static str ] } ,
2525 JitBin { source : & ' static str , args : & ' static str } ,
2626}
2727
2828impl TestCase {
2929 // 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 {
3131 Self { config, cmd : TestCaseCmd :: Custom { func } }
3232 }
3333
@@ -247,6 +247,7 @@ pub(crate) fn run_tests(
247247 channel : & str ,
248248 sysroot_kind : SysrootKind ,
249249 use_unstable_features : bool ,
250+ skip_tests : & [ & str ] ,
250251 cg_clif_dylib : & CodegenBackend ,
251252 bootstrap_host_compiler : & Compiler ,
252253 rustup_toolchain_name : Option < & str > ,
@@ -256,7 +257,7 @@ pub(crate) fn run_tests(
256257 get_default_sysroot ( & bootstrap_host_compiler. rustc ) . join ( "lib/rustlib/src/rust" ) ;
257258 assert ! ( stdlib_source. exists( ) ) ;
258259
259- if config:: get_bool ( "testsuite.no_sysroot" ) {
260+ if config:: get_bool ( "testsuite.no_sysroot" ) && !skip_tests . contains ( & "testsuite.no_sysroot" ) {
260261 let target_compiler = build_sysroot:: build_sysroot (
261262 dirs,
262263 channel,
@@ -271,6 +272,7 @@ pub(crate) fn run_tests(
271272 dirs. clone ( ) ,
272273 target_compiler,
273274 use_unstable_features,
275+ skip_tests,
274276 bootstrap_host_compiler. triple == target_triple,
275277 stdlib_source. clone ( ) ,
276278 ) ;
@@ -281,8 +283,10 @@ pub(crate) fn run_tests(
281283 eprintln ! ( "[SKIP] no_sysroot tests" ) ;
282284 }
283285
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" ) ;
286290
287291 if run_base_sysroot || run_extended_sysroot {
288292 let mut target_compiler = build_sysroot:: build_sysroot (
@@ -302,6 +306,7 @@ pub(crate) fn run_tests(
302306 dirs. clone ( ) ,
303307 target_compiler,
304308 use_unstable_features,
309+ skip_tests,
305310 bootstrap_host_compiler. triple == target_triple,
306311 stdlib_source,
307312 ) ;
@@ -320,20 +325,22 @@ pub(crate) fn run_tests(
320325 }
321326}
322327
323- struct TestRunner {
328+ struct TestRunner < ' a > {
324329 is_native : bool ,
325330 jit_supported : bool ,
326331 use_unstable_features : bool ,
332+ skip_tests : & ' a [ & ' a str ] ,
327333 dirs : Dirs ,
328334 target_compiler : Compiler ,
329335 stdlib_source : PathBuf ,
330336}
331337
332- impl TestRunner {
338+ impl < ' a > TestRunner < ' a > {
333339 fn new (
334340 dirs : Dirs ,
335341 mut target_compiler : Compiler ,
336342 use_unstable_features : bool ,
343+ skip_tests : & ' a [ & ' a str ] ,
337344 is_native : bool ,
338345 stdlib_source : PathBuf ,
339346 ) -> Self {
@@ -360,6 +367,7 @@ impl TestRunner {
360367 is_native,
361368 jit_supported,
362369 use_unstable_features,
370+ skip_tests,
363371 dirs,
364372 target_compiler,
365373 stdlib_source,
@@ -372,7 +380,10 @@ impl TestRunner {
372380 let tag = tag. to_uppercase ( ) ;
373381 let is_jit_test = tag == "JIT" ;
374382
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+ {
376387 eprintln ! ( "[{tag}] {testname} (skipped)" ) ;
377388 continue ;
378389 } else {
0 commit comments