diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 12:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 12:47:55 +0000 |
commit | 2aadc03ef15cb5ca5cc2af8a7c08e070742f0ac4 (patch) | |
tree | 033cc839730fda84ff08db877037977be94e5e3a /tests/testsuite/init/simple_bin | |
parent | Initial commit. (diff) | |
download | cargo-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/in | 1 | ||||
-rw-r--r-- | tests/testsuite/init/simple_bin/mod.rs | 29 | ||||
-rw-r--r-- | tests/testsuite/init/simple_bin/out/Cargo.toml | 8 | ||||
-rw-r--r-- | tests/testsuite/init/simple_bin/out/src/main.rs | 3 | ||||
-rw-r--r-- | tests/testsuite/init/simple_bin/stderr.log | 1 | ||||
-rw-r--r-- | tests/testsuite/init/simple_bin/stdout.log | 0 |
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 |