std.special.test_runner.zig: make tests skippable;

tracking issue #1274;

tests can be skipped by returnning `error.skip` :
master
kristopher tate 2018-07-22 02:20:03 +09:00
parent 1f4c7d5ebf
commit df574ccf86
1 changed files with 7 additions and 1 deletions

View File

@ -8,7 +8,13 @@ pub fn main() !void {
for (test_fn_list) |test_fn, i| { for (test_fn_list) |test_fn, i| {
warn("Test {}/{} {}...", i + 1, test_fn_list.len, test_fn.name); warn("Test {}/{} {}...", i + 1, test_fn_list.len, test_fn.name);
try test_fn.func(); test_fn.func() catch |err| {
if (err == error.skip) {
warn("SKIPPED\n");
continue;
}
return err;
};
warn("OK\n"); warn("OK\n");
} }