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 22
33// == Test [gdb|lldb]-[command|check] are parsed correctly ===
44// should-fail
5+ // needs-run-enabled
56// compile-flags:-g
67
78// === GDB TESTS ===================================================================================
Original file line number Diff line number Diff line change 44// run-fail
55// revisions: foo bar
66// should-fail
7+ // needs-run-enabled
78//[foo] error-pattern:bar
89//[bar] error-pattern:foo
910
Original file line number Diff line number Diff line change @@ -351,6 +351,15 @@ pub struct Config {
351351 pub npm : Option < String > ,
352352}
353353
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+
354363#[ derive( Debug , Clone ) ]
355364pub struct TestPaths {
356365 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 {
8585 props. ignore = true ;
8686 }
8787
88+ if !config. run_enabled ( ) && config. parse_name_directive ( ln, "needs-run-enabled" ) {
89+ props. ignore = true ;
90+ }
91+
8892 if !rustc_has_sanitizer_support
8993 && config. parse_name_directive ( ln, "needs-sanitizer-support" )
9094 {
Original file line number Diff line number Diff line change @@ -369,11 +369,7 @@ impl<'test> TestCx<'test> {
369369 }
370370
371371 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 }
377373 }
378374
379375 fn should_run_successfully ( & self , pm : Option < PassMode > ) -> bool {
You can’t perform that action at this time.
0 commit comments