2016-02-03 17:02:01 -08:00
|
|
|
import "std.zig";
|
|
|
|
|
|
|
|
struct TestFn {
|
|
|
|
name: []u8,
|
|
|
|
func: extern fn(),
|
|
|
|
}
|
|
|
|
|
2016-02-03 17:38:09 -08:00
|
|
|
extern var zig_test_fn_list: []TestFn;
|
2016-02-03 17:02:01 -08:00
|
|
|
|
2016-02-03 22:07:55 -08:00
|
|
|
pub fn run_tests() -> %void {
|
2016-02-03 17:38:09 -08:00
|
|
|
for (test_fn, zig_test_fn_list, i) {
|
2016-02-03 17:02:01 -08:00
|
|
|
%%stderr.print_str("Test ");
|
2016-02-03 18:07:15 -08:00
|
|
|
%%stderr.print_i64(i + 1);
|
2016-02-03 17:02:01 -08:00
|
|
|
%%stderr.print_str("/");
|
2016-02-03 17:38:09 -08:00
|
|
|
%%stderr.print_i64(zig_test_fn_list.len);
|
2016-02-03 17:02:01 -08:00
|
|
|
%%stderr.print_str(" ");
|
|
|
|
%%stderr.print_str(test_fn.name);
|
|
|
|
%%stderr.print_str("...");
|
|
|
|
|
2016-02-03 20:34:09 -08:00
|
|
|
test_fn.func();
|
2016-02-03 17:02:01 -08:00
|
|
|
|
|
|
|
|
|
|
|
%%stderr.print_str("OK\n");
|
|
|
|
%%stderr.flush();
|
|
|
|
}
|
|
|
|
}
|