2017-10-31 01:47:55 -07:00
|
|
|
const std = @import("std");
|
|
|
|
const io = std.io;
|
2017-05-01 10:12:38 -07:00
|
|
|
const builtin = @import("builtin");
|
|
|
|
const test_fn_list = builtin.__zig_test_fn_slice;
|
2017-10-31 01:47:55 -07:00
|
|
|
const warn = std.debug.warn;
|
2016-02-03 17:02:01 -08:00
|
|
|
|
2017-04-03 21:17:24 -07:00
|
|
|
pub fn main() -> %void {
|
2017-04-27 13:15:41 -07:00
|
|
|
for (test_fn_list) |test_fn, i| {
|
2017-10-31 01:47:55 -07:00
|
|
|
warn("Test {}/{} {}...", i + 1, test_fn_list.len, test_fn.name);
|
2016-02-03 17:02:01 -08:00
|
|
|
|
2018-01-14 07:19:21 -08:00
|
|
|
if (builtin.is_test) {
|
|
|
|
test_fn.func() catch unreachable;
|
|
|
|
} else {
|
|
|
|
test_fn.func() catch |err| {
|
|
|
|
warn("{}\n", err);
|
|
|
|
return err;
|
|
|
|
};
|
|
|
|
}
|
2016-02-03 17:02:01 -08:00
|
|
|
|
2017-10-31 01:47:55 -07:00
|
|
|
warn("OK\n");
|
2016-02-03 17:02:01 -08:00
|
|
|
}
|
|
|
|
}
|