File tree 1 file changed +22
-2
lines changed
1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,28 @@ use std::path::PathBuf;
6
6
fn run_mode ( mode : & ' static str ) {
7
7
let mut config = compiletest:: Config :: default ( ) ;
8
8
config. mode = mode. parse ( ) . expect ( "Invalid mode" ) ;
9
- config. src_base = PathBuf :: from ( format ! ( "tests/{}" , mode) ) ;
10
- config. target_rustcflags = Some ( "-L target/debug" . to_string ( ) ) ;
9
+ config. src_base = [ "tests" , mode] . iter ( ) . collect ( ) ;
10
+ // Create linker paths
11
+ let debug_path: PathBuf = [ "target" , "debug" ] . iter ( ) . collect ( ) ;
12
+ let mut deps_path: PathBuf = debug_path. clone ( ) ;
13
+ deps_path. push ( "deps" ) ;
14
+
15
+ // Convert linker paths to string representation
16
+ let mut target_rustcflags = "" . to_string ( ) ;
17
+ for x in [ debug_path, deps_path] . iter ( ) {
18
+ if let Some ( s) = x. to_str ( ) {
19
+ target_rustcflags. push_str ( & format ! ( "-L {} " , s) )
20
+ }
21
+ }
22
+
23
+ // Save linker flags
24
+ config. target_rustcflags = if target_rustcflags. len ( ) > 0 {
25
+ Some ( target_rustcflags)
26
+ } else {
27
+ None
28
+ } ;
29
+
30
+ config. verbose = true ;
11
31
12
32
compiletest:: run_tests ( & config) ;
13
33
}
You can’t perform that action at this time.
0 commit comments