File tree 1 file changed +43
-0
lines changed
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() {
26
26
. run ( ) ;
27
27
}
28
28
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
+
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
+
29
72
#[ cargo_test]
30
73
fn build_script_extra_link_arg ( ) {
31
74
let p = project ( )
You can’t perform that action at this time.
0 commit comments