From df574ccf8655726dc204142e7bcfb36770426257 Mon Sep 17 00:00:00 2001 From: kristopher tate Date: Sun, 22 Jul 2018 02:20:03 +0900 Subject: [PATCH] std.special.test_runner.zig: make tests skippable; tracking issue #1274; tests can be skipped by returnning `error.skip` : --- std/special/test_runner.zig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/std/special/test_runner.zig b/std/special/test_runner.zig index 76a54a501..46ed7e23e 100644 --- a/std/special/test_runner.zig +++ b/std/special/test_runner.zig @@ -8,7 +8,13 @@ pub fn main() !void { for (test_fn_list) |test_fn, i| { 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"); }