File tree Expand file tree Collapse file tree 5 files changed +16
-5
lines changed Expand file tree Collapse file tree 5 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 2
2
3
3
// == Test [gdb|lldb]-[command|check] are parsed correctly ===
4
4
// should-fail
5
+ // needs-run-enabled
5
6
// compile-flags:-g
6
7
7
8
// === GDB TESTS ===================================================================================
Original file line number Diff line number Diff line change 4
4
// run-fail
5
5
// revisions: foo bar
6
6
// should-fail
7
+ // needs-run-enabled
7
8
//[foo] error-pattern:bar
8
9
//[bar] error-pattern:foo
9
10
Original file line number Diff line number Diff line change @@ -351,6 +351,15 @@ pub struct Config {
351
351
pub npm : Option < String > ,
352
352
}
353
353
354
+ impl Config {
355
+ pub fn run_enabled ( & self ) -> bool {
356
+ self . run . unwrap_or_else ( || {
357
+ // Auto-detect whether to run based on the platform.
358
+ !self . target . ends_with ( "-fuchsia" )
359
+ } )
360
+ }
361
+ }
362
+
354
363
#[ derive( Debug , Clone ) ]
355
364
pub struct TestPaths {
356
365
pub file : PathBuf , // e.g., compile-test/foo/bar/baz.rs
Original file line number Diff line number Diff line change @@ -85,6 +85,10 @@ impl EarlyProps {
85
85
props. ignore = true ;
86
86
}
87
87
88
+ if !config. run_enabled ( ) && config. parse_name_directive ( ln, "needs-run-enabled" ) {
89
+ props. ignore = true ;
90
+ }
91
+
88
92
if !rustc_has_sanitizer_support
89
93
&& config. parse_name_directive ( ln, "needs-sanitizer-support" )
90
94
{
Original file line number Diff line number Diff line change @@ -369,11 +369,7 @@ impl<'test> TestCx<'test> {
369
369
}
370
370
371
371
fn run_if_enabled ( & self ) -> WillExecute {
372
- let enabled = self . config . run . unwrap_or_else ( || {
373
- // Auto-detect whether to run based on the platform.
374
- !self . config . target . ends_with ( "-fuchsia" )
375
- } ) ;
376
- if enabled { WillExecute :: Yes } else { WillExecute :: Disabled }
372
+ if self . config . run_enabled ( ) { WillExecute :: Yes } else { WillExecute :: Disabled }
377
373
}
378
374
379
375
fn should_run_successfully ( & self , pm : Option < PassMode > ) -> bool {
You can’t perform that action at this time.
0 commit comments