zig/std/special/test_runner.zig

19 lines
375 B
Zig
Raw Normal View History

const io = @import("std").io;
const TestFn = struct {
name: []u8,
func: extern fn(),
};
2016-02-03 17:38:09 -08:00
extern var zig_test_fn_list: []TestFn;
pub fn main(args: [][]u8) -> %void {
2016-08-16 22:42:50 -07:00
for (zig_test_fn_list) |testFn, i| {
2017-02-05 13:09:33 -08:00
%%io.stderr.printf("Test {}/{} {}...", i + 1, zig_test_fn_list.len, testFn.name);
2016-08-16 22:42:50 -07:00
testFn.func();
2017-02-05 13:09:33 -08:00
%%io.stderr.printf("OK\n");
}
}