aboutsummaryrefslogtreecommitdiff
path: root/std/special/test_runner.zig
diff options
context:
space:
mode:
authorkristopher tate <kt@connectfree.co.jp>2018-07-22 02:20:03 +0900
committerkristopher tate <kt@connectfree.co.jp>2018-07-22 02:20:03 +0900
commitdf574ccf8655726dc204142e7bcfb36770426257 (patch)
treead9c5af1fba48375955db8b9585507f7020c6e84 /std/special/test_runner.zig
parent1f4c7d5ebfd4ae88d57b6c923d9ef4d2154e193d (diff)
downloadzig-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.zig8
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");
}