File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -176,6 +176,40 @@ fn build_dep_info_dylib() {
176
176
assert ! ( p. example_lib( "ex" , "dylib" ) . with_extension( "d" ) . is_file( ) ) ;
177
177
}
178
178
179
+ #[ cargo_test]
180
+ fn dep_path_inside_target_has_correct_path ( ) {
181
+ let p = project ( )
182
+ . file ( "Cargo.toml" , & basic_bin_manifest ( "a" ) )
183
+ . file ( "target/debug/blah" , "" )
184
+ . file (
185
+ "src/main.rs" ,
186
+ r#"
187
+ fn main() {
188
+ let x = include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/target/debug/blah"));
189
+ }
190
+ "# ,
191
+ )
192
+ . build ( ) ;
193
+
194
+ p. cargo ( "build" ) . run ( ) ;
195
+
196
+ let depinfo_path = & p. bin ( "a" ) . with_extension ( "d" ) ;
197
+
198
+ assert ! ( depinfo_path. is_file( ) , "{:?}" , depinfo_path) ;
199
+
200
+ let depinfo = p. read_file ( depinfo_path. to_str ( ) . unwrap ( ) ) ;
201
+
202
+ let bin_path = p. bin ( "a" ) ;
203
+ if !depinfo. lines ( ) . any ( |line| {
204
+ line. starts_with ( & format ! ( "{}:" , bin_path. display( ) ) ) && line. contains ( "target/debug/blah" )
205
+ } ) {
206
+ panic ! (
207
+ "Could not find {:?}: target/debug/blah in {:?}" ,
208
+ bin_path, depinfo_path
209
+ ) ;
210
+ }
211
+ }
212
+
179
213
#[ cargo_test]
180
214
fn no_rewrite_if_no_change ( ) {
181
215
let p = project ( ) . file ( "src/lib.rs" , "" ) . build ( ) ;
You can’t perform that action at this time.
0 commit comments