@@ -98,7 +98,8 @@ pub fn run(input: &str, matches: &getopts::Matches) -> int {
9898 0
9999}
100100
101- fn runtest ( test : & str , cratename : & str , libs : HashSet < Path > , should_fail : bool ) {
101+ fn runtest ( test : & str , cratename : & str , libs : HashSet < Path > , should_fail : bool ,
102+ no_run : bool ) {
102103 let test = maketest ( test, cratename) ;
103104 let parsesess = parse:: new_parse_sess ( ) ;
104105 let input = driver:: StrInput ( test) ;
@@ -152,6 +153,8 @@ fn runtest(test: &str, cratename: &str, libs: HashSet<Path>, should_fail: bool)
152153 let cfg = driver:: build_configuration ( sess) ;
153154 driver:: compile_input ( sess, cfg, & input, & out, & None ) ;
154155
156+ if no_run { return }
157+
155158 // Run the code!
156159 let exe = outdir. path ( ) . join ( "rust_out" ) ;
157160 let out = Process :: output ( exe. as_str ( ) . unwrap ( ) , [ ] ) ;
@@ -203,7 +206,7 @@ pub struct Collector {
203206}
204207
205208impl Collector {
206- pub fn add_test ( & mut self , test : & str , should_fail : bool ) {
209+ pub fn add_test ( & mut self , test : & str , should_fail : bool , no_run : bool ) {
207210 let test = test. to_owned ( ) ;
208211 let name = format ! ( "{}_{}" , self . names. connect( "::" ) , self . cnt) ;
209212 self . cnt += 1 ;
@@ -218,7 +221,7 @@ impl Collector {
218221 should_fail : false , // compiler failures are test failures
219222 } ,
220223 testfn : testing:: DynTestFn ( proc ( ) {
221- runtest ( test, cratename, libs, should_fail) ;
224+ runtest ( test, cratename, libs, should_fail, no_run ) ;
222225 } ) ,
223226 } ) ;
224227 }
0 commit comments