@@ -98,7 +98,8 @@ pub fn run(input: &str, matches: &getopts::Matches) -> int {
98
98
0
99
99
}
100
100
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 ) {
102
103
let test = maketest ( test, cratename) ;
103
104
let parsesess = parse:: new_parse_sess ( ) ;
104
105
let input = driver:: StrInput ( test) ;
@@ -152,6 +153,8 @@ fn runtest(test: &str, cratename: &str, libs: HashSet<Path>, should_fail: bool)
152
153
let cfg = driver:: build_configuration ( sess) ;
153
154
driver:: compile_input ( sess, cfg, & input, & out, & None ) ;
154
155
156
+ if no_run { return }
157
+
155
158
// Run the code!
156
159
let exe = outdir. path ( ) . join ( "rust_out" ) ;
157
160
let out = Process :: output ( exe. as_str ( ) . unwrap ( ) , [ ] ) ;
@@ -203,7 +206,7 @@ pub struct Collector {
203
206
}
204
207
205
208
impl 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 ) {
207
210
let test = test. to_owned ( ) ;
208
211
let name = format ! ( "{}_{}" , self . names. connect( "::" ) , self . cnt) ;
209
212
self . cnt += 1 ;
@@ -218,7 +221,7 @@ impl Collector {
218
221
should_fail : false , // compiler failures are test failures
219
222
} ,
220
223
testfn : testing:: DynTestFn ( proc ( ) {
221
- runtest ( test, cratename, libs, should_fail) ;
224
+ runtest ( test, cratename, libs, should_fail, no_run ) ;
222
225
} ) ,
223
226
} ) ;
224
227
}
0 commit comments