2022-11-02 11:41:20 +00:00
|
|
|
const std = @import("std");
|
|
|
|
const builtin = @import("builtin");
|
|
|
|
|
|
|
|
pub fn main() void {
|
|
|
|
var ok_count: usize = 0;
|
|
|
|
var skip_count: usize = 0;
|
|
|
|
var fail_count: usize = 0;
|
|
|
|
|
2023-03-08 07:16:16 +00:00
|
|
|
for (builtin.test_functions) |test_fn| {
|
|
|
|
if (test_fn.func()) |_| {
|
2022-11-02 11:41:20 +00:00
|
|
|
ok_count += 1;
|
|
|
|
} else |err| switch (err) {
|
2023-03-08 07:16:16 +00:00
|
|
|
error.SkipZigTest => skip_count += 1,
|
|
|
|
else => fail_count += 1,
|
2022-11-02 11:41:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (ok_count != 1 or skip_count != 1 or fail_count != 1) {
|
|
|
|
std.process.exit(1);
|
|
|
|
}
|
|
|
|
}
|