| author | |
| committer | |
| log | 44292721bf6304d77ac34f2aa6c4c00d8d264d6c |
| tree | 2f70c22e1b4bf3745be179aef74d92fc8dbd4af9 |
| parent | bb1b7967111dd5add6172fb33fd9c17e7a344321 |
| parent | c5c053b6fdde911edd0b488c29fbef0e2aa0a904 |
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 | } |
| 124 | 124 | ||
| 125 | test "listen on a port, send bytes, receive bytes" { | 125 | test "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 systems | 127 | 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, |
| 132 | 139 |
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); |
| 10 | 10 | ||
| 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 | }; | ||
| 12 | 18 | ||
| 13 | warn("OK\n"); | 19 | warn("OK\n"); |
| 14 | } | 20 | } |