Skip to content

Commit

Permalink
docker run test for rust with multiple bins (railwayapp#781)
Browse files Browse the repository at this point in the history
* docker run test for rust with multiple bins

* fix dir name
  • Loading branch information
coffee-cup authored Feb 3, 2023
1 parent 5da6c15 commit 73f9f2b
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/rust-multiple-bins/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
9 changes: 9 additions & 0 deletions examples/rust-multiple-bins/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[package]
name = "rust-multiple-bins"
version = "0.1.0"
edition = "2021"
default-run = "bin1"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
3 changes: 3 additions & 0 deletions examples/rust-multiple-bins/src/bin/bin1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("This is Bin 1!");
}
3 changes: 3 additions & 0 deletions examples/rust-multiple-bins/src/bin/bin2.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("This is Bin 2!");
}
1 change: 1 addition & 0 deletions test-helper/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const IGNORE: &[&str] = &[
"rust-custom-toolchain",
"rust-cargo-workspaces",
"rust-cargo-workspaces-glob",
"rust-multiple-bins",
"ruby-no-version",
];

Expand Down
7 changes: 7 additions & 0 deletions tests/docker_run_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,13 @@ async fn test_rust_cargo_workspaces_glob() {
assert!(output.contains("Hello from rust"));
}

#[tokio::test]
async fn test_rust_multiple_bins() {
let name = simple_build("./examples/rust-multiple-bins").await;
let output = run_image(&name, None).await;
assert!(output.contains("Bin 1"));
}

#[tokio::test]
async fn test_go() {
let name = simple_build("./examples/go").await;
Expand Down

0 comments on commit 73f9f2b

Please sign in to comment.