summaryrefslogtreecommitdiffstats
path: root/tests/testsuite/init/simple_bin
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:47:55 +0000
commit2aadc03ef15cb5ca5cc2af8a7c08e070742f0ac4 (patch)
tree033cc839730fda84ff08db877037977be94e5e3a /tests/testsuite/init/simple_bin
parentInitial commit. (diff)
downloadcargo-upstream.tar.xz
cargo-upstream.zip
Adding upstream version 0.70.1+ds1.upstream/0.70.1+ds1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/testsuite/init/simple_bin')
l---------tests/testsuite/init/simple_bin/in1
-rw-r--r--tests/testsuite/init/simple_bin/mod.rs29
-rw-r--r--tests/testsuite/init/simple_bin/out/Cargo.toml8
-rw-r--r--tests/testsuite/init/simple_bin/out/src/main.rs3
-rw-r--r--tests/testsuite/init/simple_bin/stderr.log1
-rw-r--r--tests/testsuite/init/simple_bin/stdout.log0
6 files changed, 42 insertions, 0 deletions
diff --git a/tests/testsuite/init/simple_bin/in b/tests/testsuite/init/simple_bin/in
new file mode 120000
index 0000000..1202506
--- /dev/null
+++ b/tests/testsuite/init/simple_bin/in
@@ -0,0 +1 @@
+../empty_dir \ No newline at end of file
diff --git a/tests/testsuite/init/simple_bin/mod.rs b/tests/testsuite/init/simple_bin/mod.rs
new file mode 100644
index 0000000..eaf0955
--- /dev/null
+++ b/tests/testsuite/init/simple_bin/mod.rs
@@ -0,0 +1,29 @@
+use cargo_test_support::compare::assert_ui;
+use cargo_test_support::prelude::*;
+use cargo_test_support::Project;
+
+use cargo_test_support::curr_dir;
+
+#[cargo_test]
+fn case() {
+ let project = Project::from_template(curr_dir!().join("in"));
+ let project_root = &project.root();
+
+ snapbox::cmd::Command::cargo_ui()
+ .arg_line("init --bin --vcs none --edition 2015")
+ .current_dir(project_root)
+ .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);
+ assert!(!project_root.join(".gitignore").is_file());
+
+ snapbox::cmd::Command::cargo_ui()
+ .current_dir(project_root)
+ .arg("build")
+ .assert()
+ .success();
+ assert!(project.bin("case").is_file());
+}
diff --git a/tests/testsuite/init/simple_bin/out/Cargo.toml b/tests/testsuite/init/simple_bin/out/Cargo.toml
new file mode 100644
index 0000000..a6269fd
--- /dev/null
+++ b/tests/testsuite/init/simple_bin/out/Cargo.toml
@@ -0,0 +1,8 @@
+[package]
+name = "case"
+version = "0.1.0"
+edition = "2015"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
diff --git a/tests/testsuite/init/simple_bin/out/src/main.rs b/tests/testsuite/init/simple_bin/out/src/main.rs
new file mode 100644
index 0000000..e7a11a9
--- /dev/null
+++ b/tests/testsuite/init/simple_bin/out/src/main.rs
@@ -0,0 +1,3 @@
+fn main() {
+ println!("Hello, world!");
+}
diff --git a/tests/testsuite/init/simple_bin/stderr.log b/tests/testsuite/init/simple_bin/stderr.log
new file mode 100644
index 0000000..3847e4e
--- /dev/null
+++ b/tests/testsuite/init/simple_bin/stderr.log
@@ -0,0 +1 @@
+ Created binary (application) package
diff --git a/tests/testsuite/init/simple_bin/stdout.log b/tests/testsuite/init/simple_bin/stdout.log
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/testsuite/init/simple_bin/stdout.log