authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-07-21 23:32:12-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-07-21 23:32:12-04:00
log44292721bf6304d77ac34f2aa6c4c00d8d264d6c
tree2f70c22e1b4bf3745be179aef74d92fc8dbd4af9
parentbb1b7967111dd5add6172fb33fd9c17e7a344321
parentc5c053b6fdde911edd0b488c29fbef0e2aa0a904

Merge branch 'skippable-tests-issue1274' of https://github.com/kristate/zig into kristate-skippable-tests-issue1274


2 files changed, 17 insertions(+), 4 deletions(-)

std/event/tcp.zig+10-3
...@@ -123,10 +123,17 @@ pub async fn connect(loop: *Loop, _address: *const std.net.Address) !std.os.File...@@ -123,10 +123,17 @@ pub async fn connect(loop: *Loop, _address: *const std.net.Address) !std.os.File
123}123}
124124
125test "listen on a port, send bytes, receive bytes" {125test "listen on a port, send bytes, receive bytes" {
126 if (builtin.os != builtin.Os.linux) {126 // TODO build abstractions for other operating systems
127 // TODO build abstractions for other operating systems127 const skip_test: bool = switch (builtin.os) {
128 return;128 builtin.Os.linux => false,
129 //builtin.Os.macosx, builtin.Os.ios => false,
130 else => true,
131 };
132
133 if (skip_test == true) {
134 return error.skip;
129 }135 }
136
130 const MyServer = struct {137 const MyServer = struct {
131 tcp_server: Server,138 tcp_server: Server,
132139
std/special/test_runner.zig+7-1
...@@ -8,7 +8,13 @@ pub fn main() !void {...@@ -8,7 +8,13 @@ pub fn main() !void {
8 for (test_fn_list) |test_fn, i| {8 for (test_fn_list) |test_fn, i| {
9 warn("Test {}/{} {}...", i + 1, test_fn_list.len, test_fn.name);9 warn("Test {}/{} {}...", i + 1, test_fn_list.len, test_fn.name);
1010
11 try test_fn.func();11 test_fn.func() catch |err| {
12 if (err == error.skip) {
13 warn("SKIPPED\n");
14 continue;
15 }
16 return err;
17 };
1218
13 warn("OK\n");19 warn("OK\n");
14 }20 }