Skip to content

Commit

Permalink
test: resolve deps under targeted parent deps as separate
Browse files Browse the repository at this point in the history
  • Loading branch information
elchukc committed Oct 30, 2024
1 parent 165cf7c commit f01f062
Showing 1 changed file with 27 additions and 9 deletions.
36 changes: 27 additions & 9 deletions tests/testsuite/artifact_dep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1603,6 +1603,7 @@ fn dep_of_artifact_dep_same_target_specified() {
[dependencies]
bar = {{ path = "bar", artifact = "bin", target = "{target}" }}
one = {{ path = "one", artifact = "bin", target = "x86_64-fortanix-unknown-sgx" }}
"#,
),
)
Expand All @@ -1621,6 +1622,19 @@ fn dep_of_artifact_dep_same_target_specified() {
),
)
.file("bar/src/main.rs", "fn main() {}")
.file(
"one/Cargo.toml",
&format!(
r#"
[package]
name = "one"
version = "0.1.0"
[dependencies]
baz = {{ path = "../baz" }}
"#,
),
)
.file("one/src/main.rs", "fn main() {}")
.file(
"baz/Cargo.toml",
r#"
Expand All @@ -1636,8 +1650,9 @@ fn dep_of_artifact_dep_same_target_specified() {
p.cargo("check -Z bindeps")
.masquerade_as_nightly_cargo(&["bindeps"])
.with_stderr_data(str![[r#"
[LOCKING] 2 packages to latest compatible versions
[LOCKING] 3 packages to latest compatible versions
[COMPILING] baz v0.1.0 ([ROOT]/foo/baz)
[COMPILING] one v0.1.0 ([ROOT]/foo/one)
[COMPILING] bar v0.1.0 ([ROOT]/foo/bar)
[CHECKING] foo v0.1.0 ([ROOT]/foo)
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
Expand All @@ -1646,16 +1661,19 @@ fn dep_of_artifact_dep_same_target_specified() {
.with_status(0)
.run();

// TODO This command currently fails due to a bug in cargo but it should be fixed so that it succeeds in the future.
p.cargo("tree -Z bindeps")
.masquerade_as_nightly_cargo(&["bindeps"])
.with_stderr_data(
r#"...
no entry found for key
...
"#,
)
.with_status(101)
.with_stdout_data(str![
r#"
foo v0.1.0 ([ROOT]/foo)
├── bar v0.1.0 ([ROOT]/foo/bar)
│ └── baz v0.1.0 ([ROOT]/foo/baz)
└── one v0.1.0 ([ROOT]/foo/one)
└── baz v0.1.0 ([ROOT]/foo/baz)
"#
])
.with_status(0)
.run();
}

Expand Down

0 comments on commit f01f062

Please sign in to comment.