File tree Expand file tree Collapse file tree 1 file changed +59
-0
lines changed Expand file tree Collapse file tree 1 file changed +59
-0
lines changed Original file line number Diff line number Diff line change @@ -254,6 +254,65 @@ fn custom_build_script_rustc_flags() {
254254 . run ( ) ;
255255}
256256
257+ #[ cargo_test]
258+ fn custom_build_script_rustc_flags_no_space ( ) {
259+ let p = project ( )
260+ . file (
261+ "Cargo.toml" ,
262+ r#"
263+ [project]
264+
265+ name = "bar"
266+ version = "0.5.0"
267+ authors = ["wycats@example.com"]
268+
269+ [dependencies.foo]
270+ path = "foo"
271+ "# ,
272+ )
273+ . file ( "src/main.rs" , "fn main() {}" )
274+ . file (
275+ "foo/Cargo.toml" ,
276+ r#"
277+ [project]
278+
279+ name = "foo"
280+ version = "0.5.0"
281+ authors = ["wycats@example.com"]
282+ build = "build.rs"
283+ "# ,
284+ )
285+ . file ( "foo/src/lib.rs" , "" )
286+ . file (
287+ "foo/build.rs" ,
288+ r#"
289+ fn main() {
290+ println!("cargo:rustc-flags=-lnonexistinglib -L/dummy/path1 -L/dummy/path2");
291+ }
292+ "# ,
293+ )
294+ . build ( ) ;
295+
296+ p. cargo ( "build --verbose" )
297+ . with_stderr (
298+ "\
299+ [COMPILING] foo [..]
300+ [RUNNING] `rustc --crate-name build_script_build foo/build.rs [..]
301+ [RUNNING] `[..]build-script-build`
302+ [RUNNING] `rustc --crate-name foo foo/src/lib.rs [..]\
303+ -L dependency=[CWD]/target/debug/deps \
304+ -L /dummy/path1 -L /dummy/path2 -l nonexistinglib`
305+ [COMPILING] bar [..]
306+ [RUNNING] `rustc --crate-name bar src/main.rs [..]\
307+ -L dependency=[CWD]/target/debug/deps \
308+ --extern foo=[..]libfoo-[..] \
309+ -L /dummy/path1 -L /dummy/path2`
310+ [FINISHED] dev [..]
311+ " ,
312+ )
313+ . run ( ) ;
314+ }
315+
257316#[ cargo_test]
258317fn links_no_build_cmd ( ) {
259318 let p = project ( )
You can’t perform that action at this time.
0 commit comments