Skip to content

Commit

Permalink
Auto merge of #14327 - epage:14321-followup, r=weihanglo
Browse files Browse the repository at this point in the history
test(publish): More dev-dep stripping cases

This is a follow up to #14325
  • Loading branch information
bors committed Jul 31, 2024
2 parents 5ae2751 + be5064e commit 6c9bccc
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions tests/testsuite/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1609,6 +1609,9 @@ fn publish_dev_dep_stripping() {
Package::new("optional-namespaced", "1.0.0")
.feature("cat", &[])
.publish();
Package::new("optional-renamed-dep-feature", "1.0.0")
.feature("cat", &[])
.publish();
Package::new("optional-renamed-namespaced", "1.0.0")
.feature("cat", &[])
.publish();
Expand Down Expand Up @@ -1648,13 +1651,15 @@ fn publish_dev_dep_stripping() {
"normal-only/cat",
"build-only/cat",
"dev-only/cat",
"renamed-dev-only01/cat",
"normal-and-dev/cat",
"target-normal-only/cat",
"target-build-only/cat",
"target-dev-only/cat",
"target-normal-and-dev/cat",
"optional-dep-feature/cat",
"dep:optional-namespaced",
"optional-renamed-dep-feature10/cat",
"dep:optional-renamed-namespaced10",
]
Expand All @@ -1663,13 +1668,15 @@ fn publish_dev_dep_stripping() {
normal-and-dev = { version = "1.0", features = ["cat"] }
optional-dep-feature = { version = "1.0", features = ["cat"], optional = true }
optional-namespaced = { version = "1.0", features = ["cat"], optional = true }
optional-renamed-dep-feature10 = { version = "1.0", features = ["cat"], optional = true, package = "optional-renamed-dep-feature" }
optional-renamed-namespaced10 = { version = "1.0", features = ["cat"], optional = true, package = "optional-renamed-namespaced" }
[build-dependencies]
build-only = { version = "1.0", features = ["cat"] }
[dev-dependencies]
dev-only = { path = "../dev-only", features = ["cat"] }
renamed-dev-only01 = { path = "../renamed-dev-only", features = ["cat"], package = "renamed-dev-only" }
normal-and-dev = { version = "1.0", features = ["cat"] }
[target.'cfg(unix)'.dependencies]
Expand Down Expand Up @@ -1705,6 +1712,26 @@ fn publish_dev_dep_stripping() {
pub fn cat() {}
"#,
)
.file(
"renamed-dev-only/Cargo.toml",
r#"
[package]
name = "renamed-dev-only"
version = "0.1.0"
edition = "2015"
authors = []
[features]
cat = []
"#,
)
.file(
"renamed-dev-only/src/lib.rs",
r#"
#[cfg(feature = "cat")]
pub fn cat() {}
"#,
)
.build();

p.cargo("publish --no-verify")
Expand Down Expand Up @@ -1775,6 +1802,18 @@ You may press ctrl-c to skip waiting; the crate should be available shortly.
"target": null,
"version_req": "^1.0"
},
{
"default_features": true,
"explicit_name_in_toml": "optional-renamed-dep-feature10",
"features": [
"cat"
],
"kind": "normal",
"name": "optional-renamed-dep-feature",
"optional": true,
"target": null,
"version_req": "^1.0"
},
{
"default_features": true,
"explicit_name_in_toml": "optional-renamed-namespaced10",
Expand Down Expand Up @@ -1866,6 +1905,7 @@ You may press ctrl-c to skip waiting; the crate should be available shortly.
"target-normal-and-dev/cat",
"optional-dep-feature/cat",
"dep:optional-namespaced",
"optional-renamed-dep-feature10/cat",
"dep:optional-renamed-namespaced10"
]
},
Expand Down Expand Up @@ -1927,6 +1967,12 @@ version = "1.0"
features = ["cat"]
optional = true
[dependencies.optional-renamed-dep-feature10]
version = "1.0"
features = ["cat"]
optional = true
package = "optional-renamed-dep-feature"
[dependencies.optional-renamed-namespaced10]
version = "1.0"
features = ["cat"]
Expand All @@ -1951,6 +1997,7 @@ foo_feature = [
"target-normal-and-dev/cat",
"optional-dep-feature/cat",
"dep:optional-namespaced",
"optional-renamed-dep-feature10/cat",
"dep:optional-renamed-namespaced10",
]
Expand Down

0 comments on commit 6c9bccc

Please sign in to comment.