File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,8 @@ pub struct TestCase {
110
110
111
111
impl TestCase {
112
112
pub fn build ( & self , manifest : & Manifest ) {
113
- std:: fs:: create_dir_all ( self . output . parent ( ) . unwrap ( ) ) . unwrap ( ) ;
113
+ let output_dir = self . output . parent ( ) . unwrap ( ) ;
114
+ std:: fs:: create_dir_all ( output_dir) . unwrap ( ) ;
114
115
let mut command = manifest. rustc ( ) ;
115
116
command
116
117
. args ( [ "--crate-type" , "bin" ] )
@@ -123,14 +124,15 @@ impl TestCase {
123
124
}
124
125
125
126
pub fn build_lib ( & self , manifest : & Manifest ) {
126
- std:: fs:: create_dir_all ( self . output . parent ( ) . unwrap ( ) ) . unwrap ( ) ;
127
+ let output_dir = self . output . parent ( ) . unwrap ( ) ;
128
+ std:: fs:: create_dir_all ( output_dir) . unwrap ( ) ;
127
129
let mut command = manifest. rustc ( ) ;
128
130
command
129
131
. args ( [ "--crate-type" , "lib" ] )
130
132
. arg ( "-O" )
131
133
. arg ( & self . source )
132
- . arg ( "--out-dir" )
133
- . arg ( self . output . parent ( ) . unwrap ( ) ) ;
134
+ . arg ( "--out-dir" ) // we use `--out-dir` to integrate with the default name convention
135
+ . arg ( output_dir ) ; // so here we ignore the filename and just use the directory
134
136
log:: debug!( "running {:?}" , command) ;
135
137
command. status ( ) . unwrap ( ) ;
136
138
}
You can’t perform that action at this time.
0 commit comments