@@ -489,7 +489,7 @@ fn build_session_options(match: getopts::match)
489
489
ret sopts;
490
490
}
491
491
492
- fn build_session ( sopts : @session:: options ) -> session:: session {
492
+ fn build_session ( sopts : @session:: options , input : str ) -> session:: session {
493
493
let target_cfg = build_target_config ( sopts) ;
494
494
let cstore = cstore:: mk_cstore ( ) ;
495
495
let filesearch = filesearch:: mk_filesearch (
@@ -498,7 +498,7 @@ fn build_session(sopts: @session::options) -> session::session {
498
498
sopts. addl_lib_search_paths ) ;
499
499
ret session:: session ( target_cfg, sopts, cstore,
500
500
@{ cm: codemap:: new_codemap ( ) , mutable next_id: 1 } ,
501
- none, 0 u, filesearch, false ) ;
501
+ none, 0 u, filesearch, false , fs :: dirname ( input ) ) ;
502
502
}
503
503
504
504
fn parse_pretty ( sess : session:: session , & & name: str ) -> pp_mode {
@@ -644,7 +644,7 @@ fn main(args: [str]) {
644
644
} ;
645
645
646
646
let sopts = build_session_options( match ) ;
647
- let sess = build_session ( sopts) ;
647
+ let sess = build_session ( sopts, ifile ) ;
648
648
let odir = getopts:: opt_maybe_str( match , "out-dir" ) ;
649
649
let ofile = getopts:: opt_maybe_str( match , "o" ) ;
650
650
let cfg = build_configuration ( sess, binary, ifile) ;
@@ -676,7 +676,7 @@ mod test {
676
676
ok ( m) { m }
677
677
} ;
678
678
let sessopts = build_session_options ( match ) ;
679
- let sess = build_session ( sessopts) ;
679
+ let sess = build_session ( sessopts, "" ) ;
680
680
let cfg = build_configuration ( sess, "whatever" , "whatever" ) ;
681
681
assert ( attr:: contains_name ( cfg, "test" ) ) ;
682
682
}
@@ -690,7 +690,7 @@ mod test {
690
690
ok ( m) { m }
691
691
} ;
692
692
let sessopts = build_session_options ( match ) ;
693
- let sess = build_session ( sessopts) ;
693
+ let sess = build_session ( sessopts, "" ) ;
694
694
let cfg = build_configuration ( sess, "whatever" , "whatever" ) ;
695
695
let test_items = attr:: find_meta_items_by_name ( cfg, "test" ) ;
696
696
assert ( vec:: len ( test_items) == 1 u) ;
0 commit comments