@@ -1497,6 +1497,55 @@ foo v0.0.0 ([CWD])
1497
1497
)
1498
1498
. run ( ) ;
1499
1499
}
1500
+
1501
+ #[ cargo_test]
1502
+ fn artifact_dep_target_specified ( ) {
1503
+ if cross_compile:: disabled ( ) {
1504
+ return ;
1505
+ }
1506
+ let target = cross_compile:: alternate ( ) ;
1507
+
1508
+ let p = project ( )
1509
+ . file (
1510
+ "Cargo.toml" ,
1511
+ & r#"
1512
+ [package]
1513
+ name = "foo"
1514
+ version = "0.0.0"
1515
+ authors = []
1516
+ resolver = "2"
1517
+
1518
+ [dependencies]
1519
+ bindep = { path = "bindep", artifact = "bin", target = "$TARGET" }
1520
+ "#
1521
+ . replace ( "$TARGET" , target) ,
1522
+ )
1523
+ . file ( "src/lib.rs" , "" )
1524
+ . file ( "bindep/Cargo.toml" , & basic_manifest ( "bindep" , "0.0.0" ) )
1525
+ . file ( "bindep/src/main.rs" , "fn main() {}" )
1526
+ . build ( ) ;
1527
+
1528
+ p. cargo ( "check -Z bindeps" )
1529
+ . masquerade_as_nightly_cargo ( & [ "bindeps" ] )
1530
+ . with_stderr_contains (
1531
+ r#"[COMPILING] bindep v0.0.0 ([CWD]/bindep)
1532
+ [CHECKING] foo v0.0.0 ([CWD])
1533
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]"# ,
1534
+ )
1535
+ . with_status ( 0 )
1536
+ . run ( ) ;
1537
+
1538
+ // TODO: This command currently fails due to a bug in cargo but it should be fixed so that it succeeds in the future.
1539
+ p. cargo ( "tree -Z bindeps" )
1540
+ . masquerade_as_nightly_cargo ( & [ "bindeps" ] )
1541
+ . with_stdout ( "" )
1542
+ . with_stderr_contains (
1543
+ r#"activated_features for invalid package: features did not find PackageId { name: "bindep", version: "0.0.0", source: "[..]" } NormalOrDev"#
1544
+ )
1545
+ . with_status ( 101 )
1546
+ . run ( ) ;
1547
+ }
1548
+
1500
1549
#[ cargo_test]
1501
1550
fn targets_are_picked_up_from_non_workspace_artifact_deps ( ) {
1502
1551
if cross_compile:: disabled ( ) {
0 commit comments