@@ -130,7 +130,7 @@ fn run_pretty_test(config: config, props: test_props, testfile: str) {
130
130
compare_source ( expected, actual) ;
131
131
132
132
// Finally, let's make sure it actually appears to remain valid code
133
- let procres = typecheck_source ( config, testfile, actual) ;
133
+ let procres = typecheck_source ( config, props , testfile, actual) ;
134
134
135
135
if procres. status != 0 {
136
136
fatal_procres ( "pretty-printed source does not typecheck" , procres) ;
@@ -169,9 +169,10 @@ actual:\n\
169
169
}
170
170
}
171
171
172
- fn typecheck_source ( config : config , testfile : str , src : str ) -> procres {
173
- compose_and_run ( config, testfile, make_typecheck_args,
174
- config. compile_lib_path , option:: some ( src) )
172
+ fn typecheck_source ( config : config , props : test_props ,
173
+ testfile : str , src : str ) -> procres {
174
+ compose_and_run_compiler (
175
+ config, props, testfile, make_typecheck_args, option:: some ( src) )
175
176
}
176
177
177
178
fn make_typecheck_args ( config : config , _testfile : str ) -> procargs {
@@ -285,6 +286,25 @@ type procres = {status: int, stdout: str, stderr: str, cmdline: str};
285
286
286
287
fn compile_test ( config : config , props : test_props ,
287
288
testfile : str ) -> procres {
289
+ compose_and_run_compiler ( config, props, testfile,
290
+ make_compile_args ( _, props, [ ] , make_exe_name, _) ,
291
+ none)
292
+ }
293
+
294
+ fn exec_compiled_test ( config : config , props : test_props ,
295
+ testfile : str ) -> procres {
296
+ compose_and_run ( config, testfile,
297
+ bind make_run_args ( _, props, _) ,
298
+ config. run_lib_path , option:: none)
299
+ }
300
+
301
+ fn compose_and_run_compiler (
302
+ config : config ,
303
+ props : test_props ,
304
+ testfile : str ,
305
+ mk_args : fn ( config : config , _testfile : str ) -> procargs ,
306
+ input : option < str > ) -> procres {
307
+
288
308
vec:: iter ( props. aux_builds ) { |rel_ab|
289
309
let abs_ab = path:: connect ( config. aux_base , rel_ab) ;
290
310
let auxres = compose_and_run ( config, abs_ab,
@@ -298,19 +318,12 @@ fn compile_test(config: config, props: test_props,
298
318
}
299
319
}
300
320
301
- compose_and_run ( config, testfile,
302
- make_compile_args ( _, props, [ ] , make_exe_name, _) ,
303
- config. compile_lib_path , option:: none)
304
- }
305
-
306
- fn exec_compiled_test ( config : config , props : test_props ,
307
- testfile : str ) -> procres {
308
- compose_and_run ( config, testfile, bind make_run_args ( _, props, _) ,
309
- config. run_lib_path , option:: none)
321
+ compose_and_run ( config, testfile, mk_args,
322
+ config. compile_lib_path , input)
310
323
}
311
324
312
325
fn compose_and_run ( config : config , testfile : str ,
313
- make_args : fn @ ( config , str ) -> procargs , lib_path : str ,
326
+ make_args : fn ( config , str ) -> procargs , lib_path : str ,
314
327
input : option < str > ) -> procres {
315
328
let procargs = make_args ( config, testfile) ;
316
329
ret program_output ( config, testfile, lib_path,
0 commit comments