summaryrefslogtreecommitdiffstats
path: root/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:41:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:41:41 +0000
commit10ee2acdd26a7f1298c6f6d6b7af9b469fe29b87 (patch)
treebdffd5d80c26cf4a7a518281a204be1ace85b4c1 /src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default
parentReleasing progress-linux version 1.70.0+dfsg1-9~progress7.99u1. (diff)
downloadrustc-10ee2acdd26a7f1298c6f6d6b7af9b469fe29b87.tar.xz
rustc-10ee2acdd26a7f1298c6f6d6b7af9b469fe29b87.zip
Merging upstream version 1.70.0+dfsg2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default')
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/in/Cargo.toml2
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/in/dependency/Cargo.toml13
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/in/dependency/src/lib.rs0
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/in/optional/Cargo.toml6
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/in/optional/src/lib.rs0
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/in/primary/Cargo.toml3
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/in/primary/src/lib.rs0
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/mod.rs30
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/out/Cargo.toml2
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/out/dependency/Cargo.toml13
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/out/primary/Cargo.toml6
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/stderr.log7
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/stdout.log0
13 files changed, 82 insertions, 0 deletions
diff --git a/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/in/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/in/Cargo.toml
new file mode 100644
index 000000000..299859e79
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/in/Cargo.toml
@@ -0,0 +1,2 @@
+[workspace]
+members = ["primary", "dependency", "optional"]
diff --git a/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/in/dependency/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/in/dependency/Cargo.toml
new file mode 100644
index 000000000..18041a53f
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/in/dependency/Cargo.toml
@@ -0,0 +1,13 @@
+[package]
+name = "your-face"
+version = "0.1.3"
+
+[dependencies]
+my-package = "0.1.1"
+optional-dependency = { path = "../optional", optional = true }
+
+[features]
+default = ["mouth"]
+nose = []
+mouth = ["nose"]
+eyes = []
diff --git a/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/in/dependency/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/in/dependency/src/lib.rs
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/in/dependency/src/lib.rs
diff --git a/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/in/optional/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/in/optional/Cargo.toml
new file mode 100644
index 000000000..cb61a0514
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/in/optional/Cargo.toml
@@ -0,0 +1,6 @@
+[package]
+name = "optional-dependency"
+version = "0.1.3"
+
+[dependencies]
+my-package = "0.1.1"
diff --git a/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/in/optional/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/in/optional/src/lib.rs
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/in/optional/src/lib.rs
diff --git a/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/in/primary/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/in/primary/Cargo.toml
new file mode 100644
index 000000000..5e20016d7
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/in/primary/Cargo.toml
@@ -0,0 +1,3 @@
+[package]
+name = "cargo-list-test-fixture"
+version = "0.0.0"
diff --git a/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/in/primary/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/in/primary/src/lib.rs
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/in/primary/src/lib.rs
diff --git a/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/mod.rs b/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/mod.rs
new file mode 100644
index 000000000..f520b2aca
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/mod.rs
@@ -0,0 +1,30 @@
+use cargo_test_support::compare::assert_ui;
+use cargo_test_support::prelude::*;
+use cargo_test_support::Project;
+
+use crate::cargo_add::init_registry;
+use cargo_test_support::curr_dir;
+
+#[cargo_test]
+fn case() {
+ init_registry();
+ let project = Project::from_template(curr_dir!().join("in"));
+ let project_root = project.root();
+ let cwd = project_root.join("primary");
+
+ snapbox::cmd::Command::cargo_ui()
+ .arg("add")
+ .args([
+ "your-face",
+ "--path",
+ "../dependency",
+ "--no-default-features",
+ ])
+ .current_dir(&cwd)
+ .assert()
+ .success()
+ .stdout_matches_path(curr_dir!().join("stdout.log"))
+ .stderr_matches_path(curr_dir!().join("stderr.log"));
+
+ assert_ui().subset_matches(curr_dir!().join("out"), &project_root);
+}
diff --git a/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/out/Cargo.toml
new file mode 100644
index 000000000..299859e79
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/out/Cargo.toml
@@ -0,0 +1,2 @@
+[workspace]
+members = ["primary", "dependency", "optional"]
diff --git a/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/out/dependency/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/out/dependency/Cargo.toml
new file mode 100644
index 000000000..18041a53f
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/out/dependency/Cargo.toml
@@ -0,0 +1,13 @@
+[package]
+name = "your-face"
+version = "0.1.3"
+
+[dependencies]
+my-package = "0.1.1"
+optional-dependency = { path = "../optional", optional = true }
+
+[features]
+default = ["mouth"]
+nose = []
+mouth = ["nose"]
+eyes = []
diff --git a/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/out/primary/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/out/primary/Cargo.toml
new file mode 100644
index 000000000..0b0400d51
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/out/primary/Cargo.toml
@@ -0,0 +1,6 @@
+[package]
+name = "cargo-list-test-fixture"
+version = "0.0.0"
+
+[dependencies]
+your-face = { version = "0.1.3", path = "../dependency", default-features = false }
diff --git a/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/stderr.log b/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/stderr.log
new file mode 100644
index 000000000..7f47a220e
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/stderr.log
@@ -0,0 +1,7 @@
+ Adding your-face (local) to dependencies.
+ Features:
+ - eyes
+ - mouth
+ - nose
+ - optional-dependency
+ Updating `dummy-registry` index
diff --git a/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/stdout.log b/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/stdout.log
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/cargo_add/list_features_path_no_default/stdout.log