From 907c12f08039ad7abe20638a26b4847b787beac3 Mon Sep 17 00:00:00 2001 From: Philipp Polterauer Date: Wed, 17 Jan 2024 19:07:25 +0100 Subject: [PATCH] added additional test package --- tests/testpackage/Cargo.toml | 1 + tests/testpackage_nodefault/Cargo.lock | 7 +++++++ tests/testpackage_nodefault/Cargo.toml | 17 +++++++++++++++++ tests/testpackage_nodefault/examples/hello.rs | 3 +++ tests/testpackage_nodefault/src/another/main.rs | 9 +++++++++ tests/testpackage_nodefault/src/main.rs | 3 +++ 6 files changed, 40 insertions(+) create mode 100644 tests/testpackage_nodefault/Cargo.lock create mode 100644 tests/testpackage_nodefault/Cargo.toml create mode 100644 tests/testpackage_nodefault/examples/hello.rs create mode 100644 tests/testpackage_nodefault/src/another/main.rs create mode 100644 tests/testpackage_nodefault/src/main.rs diff --git a/tests/testpackage/Cargo.toml b/tests/testpackage/Cargo.toml index 3882858..141b698 100644 --- a/tests/testpackage/Cargo.toml +++ b/tests/testpackage/Cargo.toml @@ -3,6 +3,7 @@ name = "testpackage" version = "0.1.0" edition = "2021" publish = false +default-run = "main" [[bin]] name = "another" diff --git a/tests/testpackage_nodefault/Cargo.lock b/tests/testpackage_nodefault/Cargo.lock new file mode 100644 index 0000000..79a947a --- /dev/null +++ b/tests/testpackage_nodefault/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "testpackage" +version = "0.1.0" diff --git a/tests/testpackage_nodefault/Cargo.toml b/tests/testpackage_nodefault/Cargo.toml new file mode 100644 index 0000000..3882858 --- /dev/null +++ b/tests/testpackage_nodefault/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "testpackage" +version = "0.1.0" +edition = "2021" +publish = false + +[[bin]] +name = "another" +path = "src/another/main.rs" + +[[bin]] +name = "main" +path = "src/main.rs" + +[profile.samply] +inherits = "release" +debug = true diff --git a/tests/testpackage_nodefault/examples/hello.rs b/tests/testpackage_nodefault/examples/hello.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/tests/testpackage_nodefault/examples/hello.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} diff --git a/tests/testpackage_nodefault/src/another/main.rs b/tests/testpackage_nodefault/src/another/main.rs new file mode 100644 index 0000000..3bad3ba --- /dev/null +++ b/tests/testpackage_nodefault/src/another/main.rs @@ -0,0 +1,9 @@ +fn main(){ + // read arguments + let args = std::env::args().collect::>(); + if args.len() < 2 { + println!("Hello, world!"); + }else{ + println!("Hello, {}!", args[1]); + } +} diff --git a/tests/testpackage_nodefault/src/main.rs b/tests/testpackage_nodefault/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/tests/testpackage_nodefault/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +}