diff --git a/test/config.sh b/test/config.sh index 72661a8901..59fed154d4 100644 --- a/test/config.sh +++ b/test/config.sh @@ -190,6 +190,9 @@ imageTests+=( ruby-bundler ruby-nonroot ' + [rust]=' + rust-hello-world + ' [silverpeas]=' silverpeas-basics ' diff --git a/test/tests/run-rust-in-container.sh b/test/tests/run-rust-in-container.sh new file mode 100755 index 0000000000..9790d13571 --- /dev/null +++ b/test/tests/run-rust-in-container.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -e + +testDir="$(readlink -f "$(dirname "$BASH_SOURCE")")" +runDir="$(dirname "$(readlink -f "$BASH_SOURCE")")" + +source "$runDir/run-in-container.sh" "$testDir" "$1" cargo run -q --manifest-path=container/Cargo.toml + diff --git a/test/tests/rust-hello-world/container/Cargo.toml b/test/tests/rust-hello-world/container/Cargo.toml new file mode 100644 index 0000000000..bccef9c084 --- /dev/null +++ b/test/tests/rust-hello-world/container/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "container" +version = "0.1.0" +authors = ["Steven Fackler "] + +[dependencies] +libc = "0.2" # just make sure we can pull dependencies diff --git a/test/tests/rust-hello-world/container/src/main.rs b/test/tests/rust-hello-world/container/src/main.rs new file mode 100644 index 0000000000..e7a11a969c --- /dev/null +++ b/test/tests/rust-hello-world/container/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} diff --git a/test/tests/rust-hello-world/expected-std-out.txt b/test/tests/rust-hello-world/expected-std-out.txt new file mode 100644 index 0000000000..af5626b4a1 --- /dev/null +++ b/test/tests/rust-hello-world/expected-std-out.txt @@ -0,0 +1 @@ +Hello, world! diff --git a/test/tests/rust-hello-world/run.sh b/test/tests/rust-hello-world/run.sh new file mode 120000 index 0000000000..ad54c79eed --- /dev/null +++ b/test/tests/rust-hello-world/run.sh @@ -0,0 +1 @@ +../run-rust-in-container.sh \ No newline at end of file