1 extern crate libtest_mimic;
2
3 use std::{thread, time};
4 use libtest_mimic::{Arguments, Trial, Failed};
5
6
main()7 fn main() {
8 let args = Arguments::from_args();
9
10 let tests = vec![
11 Trial::test("check_toph", check_toph),
12 Trial::test("check_sokka", check_sokka),
13 Trial::test("long_computation", long_computation).with_ignored_flag(true),
14 Trial::test("foo", compile_fail_dummy).with_kind("compile-fail"),
15 Trial::test("check_katara", check_katara),
16 ];
17
18 libtest_mimic::run(&args, tests).exit();
19 }
20
21
22 // Tests
23
check_toph() -> Result<(), Failed>24 fn check_toph() -> Result<(), Failed> {
25 Ok(())
26 }
check_katara() -> Result<(), Failed>27 fn check_katara() -> Result<(), Failed> {
28 Ok(())
29 }
check_sokka() -> Result<(), Failed>30 fn check_sokka() -> Result<(), Failed> {
31 Err("Sokka tripped and fell :(".into())
32 }
long_computation() -> Result<(), Failed>33 fn long_computation() -> Result<(), Failed> {
34 thread::sleep(time::Duration::from_secs(1));
35 Ok(())
36 }
compile_fail_dummy() -> Result<(), Failed>37 fn compile_fail_dummy() -> Result<(), Failed> {
38 Ok(())
39 }
40