@@ -167,16 +167,16 @@ fn scrape_test_config(krate: &::rustc::hir::Crate) -> TestOptions {
167
167
opts
168
168
}
169
169
170
- fn runtest ( test : & str , cratename : & str , cfgs : Vec < String > , libs : SearchPaths ,
171
- externs : Externs ,
172
- should_panic : bool , no_run : bool , as_test_harness : bool ,
173
- compile_fail : bool , mut error_codes : Vec < String > , opts : & TestOptions ,
174
- maybe_sysroot : Option < PathBuf > ) {
170
+ fn run_test ( test : & str , cratename : & str , filename : & str , cfgs : Vec < String > , libs : SearchPaths ,
171
+ externs : Externs ,
172
+ should_panic : bool , no_run : bool , as_test_harness : bool ,
173
+ compile_fail : bool , mut error_codes : Vec < String > , opts : & TestOptions ,
174
+ maybe_sysroot : Option < PathBuf > ) {
175
175
// the test harness wants its own `main` & top level functions, so
176
176
// never wrap the test in `fn main() { ... }`
177
- let test = maketest ( test, Some ( cratename) , as_test_harness, opts) ;
177
+ let test = make_test ( test, Some ( cratename) , as_test_harness, opts) ;
178
178
let input = config:: Input :: Str {
179
- name : driver :: anon_src ( ) ,
179
+ name : filename . to_owned ( ) ,
180
180
input : test. to_owned ( ) ,
181
181
} ;
182
182
let outputs = OutputTypes :: new ( & [ ( OutputType :: Exe , None ) ] ) ;
@@ -313,8 +313,11 @@ fn runtest(test: &str, cratename: &str, cfgs: Vec<String>, libs: SearchPaths,
313
313
}
314
314
}
315
315
316
- pub fn maketest ( s : & str , cratename : Option < & str > , dont_insert_main : bool ,
317
- opts : & TestOptions ) -> String {
316
+ pub fn make_test ( s : & str ,
317
+ cratename : Option < & str > ,
318
+ dont_insert_main : bool ,
319
+ opts : & TestOptions )
320
+ -> String {
318
321
let ( crate_attrs, everything_else) = partition_source ( s) ;
319
322
320
323
let mut prog = String :: new ( ) ;
@@ -498,18 +501,19 @@ impl Collector {
498
501
rustc_driver:: in_rustc_thread ( move || {
499
502
io:: set_panic ( panic) ;
500
503
io:: set_print ( print) ;
501
- runtest ( & test,
502
- & cratename,
503
- cfgs,
504
- libs,
505
- externs,
506
- should_panic,
507
- no_run,
508
- as_test_harness,
509
- compile_fail,
510
- error_codes,
511
- & opts,
512
- maybe_sysroot)
504
+ run_test ( & test,
505
+ & cratename,
506
+ & filename,
507
+ cfgs,
508
+ libs,
509
+ externs,
510
+ should_panic,
511
+ no_run,
512
+ as_test_harness,
513
+ compile_fail,
514
+ error_codes,
515
+ & opts,
516
+ maybe_sysroot)
513
517
} )
514
518
} {
515
519
Ok ( ( ) ) => ( ) ,
0 commit comments