diff options
| author | kristopher tate <kt@connectfree.co.jp> | 2018-07-22 02:20:03 +0900 |
|---|---|---|
| committer | kristopher tate <kt@connectfree.co.jp> | 2018-07-22 02:20:03 +0900 |
| commit | df574ccf8655726dc204142e7bcfb36770426257 (patch) | |
| tree | ad9c5af1fba48375955db8b9585507f7020c6e84 /std/special/test_runner.zig | |
| parent | 1f4c7d5ebfd4ae88d57b6c923d9ef4d2154e193d (diff) | |
| download | zig-df574ccf8655726dc204142e7bcfb36770426257.tar.gz zig-df574ccf8655726dc204142e7bcfb36770426257.zip | |
std.special.test_runner.zig: make tests skippable;
tracking issue #1274;
tests can be skipped by returnning `error.skip` :
Diffstat (limited to 'std/special/test_runner.zig')
| -rw-r--r-- | std/special/test_runner.zig | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/std/special/test_runner.zig b/std/special/test_runner.zig index 76a54a5018..46ed7e23e9 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"); } |
