File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,49 @@ fn build_script_extra_link_arg_bin() {
2626 . run ( ) ;
2727}
2828
29+ #[ cargo_test]
30+ fn build_script_extra_link_arg_bin_single ( ) {
31+ let p = project ( )
32+ . file (
33+ "Cargo.toml" ,
34+ r#"
35+ [package]
36+
37+ name = "foobar"
38+ version = "0.5.0"
39+ authors = ["wycats@example.com"]
40+
41+ [[bin]]
42+ name = "foo"
43+ [[bin]]
44+ name = "bar"
45+ "# ,
46+ )
47+ . file ( "src/main.rs" , "fn main() {}" )
48+ . file (
49+ "build.rs" ,
50+ r#"
51+ fn main() {
52+ println!("cargo:rustc-link-arg-bins=--bogus-flag-all");
53+ println!("cargo:rustc-link-arg-bin=foo=--bogus-flag-foo");
54+ println!("cargo:rustc-link-arg-bin=bar=--bogus-flag-bar");
55+ }
56+ "# ,
57+ )
58+ . build ( ) ;
59+
60+ p. cargo ( "build -Zextra-link-arg -v" )
61+ . masquerade_as_nightly_cargo ( )
62+ . without_status ( )
63+ . with_stderr_contains (
64+ "[RUNNING] `rustc --crate-name foo [..]-C link-arg=--bogus-flag-all -C link-arg=--bogus-flag-foo[..]" ,
65+ )
66+ . with_stderr_contains (
67+ "[RUNNING] `rustc --crate-name bar [..]-C link-arg=--bogus-flag-all -C link-arg=--bogus-flag-bar[..]" ,
68+ )
69+ . run ( ) ;
70+ }
71+
2972#[ cargo_test]
3073fn build_script_extra_link_arg ( ) {
3174 let p = project ( )
You can’t perform that action at this time.
0 commit comments