File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 1+ use std:: env;
12use std:: fs:: { read_dir, remove_file} ;
23
34// Workaround for https://github.com/laumann/compiletest-rs/issues/114
@@ -26,6 +27,20 @@ fn clean_rlibs(config: &compiletest_rs::Config) {
2627 }
2728}
2829
30+ fn link_deps ( config : & mut compiletest_rs:: Config ) {
31+ // https://github.com/laumann/compiletest-rs/issues/155
32+ if cfg ! ( target_os = "macos" ) {
33+ if let Ok ( lib_paths) = env:: var ( "DYLD_FALLBACK_LIBRARY_PATH" ) {
34+ let mut flags = config. target_rustcflags . take ( ) . unwrap_or_else ( String :: new) ;
35+ for p in env:: split_paths ( & lib_paths) {
36+ flags += " -L " ;
37+ flags += p. to_str ( ) . unwrap ( ) ; // Can't fail. We already know this is unicode
38+ }
39+ config. target_rustcflags = Some ( flags) ;
40+ }
41+ }
42+ }
43+
2944fn run_mode ( mode : & ' static str ) {
3045 let mut config = compiletest_rs:: Config :: default ( ) ;
3146 let cfg_mode = mode. parse ( ) . expect ( "Invalid mode" ) ;
@@ -34,6 +49,7 @@ fn run_mode(mode: &'static str) {
3449 config. src_base = format ! ( "tests/{}" , mode) . into ( ) ;
3550 config. verbose = false ;
3651 config. link_deps ( ) ;
52+ link_deps ( & mut config) ;
3753 // clean_rlibs(&config); // commented out for now as it's flaky on CI
3854
3955 compiletest_rs:: run_tests ( & config) ;
You can’t perform that action at this time.
0 commit comments