Warning: this runner has been deprecated in favor of the rust image, which is more flexible and generic.
See the https://github.com/TechDotIO/rust repository for more details.
This is a Rust 1.15 runner that:
cargo build (i.e. fetches dependencies and compiles initial source files)cargo test command.In order to use this runner for your project, edit the techio.yml file and add the following lines to your project:
runner: techio/rust-cargo-runner:1.0.0-rust-1.15
Given the following project:
.
├── Cargo.toml
├── techio.yml
└── src
├── lib.rs
├── string_tests.rs
└── uppercase.rs
In this example, the user is asked to write the function to_upper (file uppercase.rs):
pub fn to_upper(string: &str) -> String {
return string.to_uppercase();
}
In order to test the answer, the following unit test is created (file string_tests.rs):
#[test]
pub fn test_to_upper() {
use uppercase;
let expected = "FOO";
let actual = uppercase::to_upper("foO");
assert_eq!(expected, actual);
}
and the file lib.rs:
pub mod string_tests;
pub mod uppercase;
In the markdown file, the unit test can be called using:
@[Test uppercase]({"stubs":["uppercase.rs"], "command":"string_tests::test_to_upper"})
Content type
Image
Digest
Size
326.2 MB
Last updated
about 9 years ago
docker pull techio/rust-cargo-runner