| author | |
| committer | |
| log | 0a32f80d9af45692eda105353c908470925ba892 |
| tree | d3ab6917d1707b87fa22ed7d6d2db5c0332258ca |
| parent | bb1b7967111dd5add6172fb33fd9c17e7a344321 |
| parent | 4d9964a457084d41ba2995082d0e25b195757751 |
2 files changed, 19 insertions(+), 4 deletions(-)
std/event/tcp.zig+2-1| ... | @@ -125,8 +125,9 @@ pub async fn connect(loop: *Loop, _address: *const std.net.Address) !std.os.File | ... | @@ -125,8 +125,9 @@ pub async fn connect(loop: *Loop, _address: *const std.net.Address) !std.os.File |
| 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 | if (builtin.os != builtin.Os.linux) { |
| 127 | // TODO build abstractions for other operating systems | 127 | // TODO build abstractions for other operating systems |
| 128 | return; | 128 | return error.SkipZigTest; |
| 129 | } | 129 | } |
| 130 | |||
| 130 | const MyServer = struct { | 131 | const MyServer = struct { |
| 131 | tcp_server: Server, | 132 | tcp_server: Server, |
| 132 | 133 |
std/special/test_runner.zig+17-3| ... | @@ -5,11 +5,25 @@ const test_fn_list = builtin.__zig_test_fn_slice; | ... | @@ -5,11 +5,25 @@ const test_fn_list = builtin.__zig_test_fn_slice; |
| 5 | const warn = std.debug.warn; | 5 | const warn = std.debug.warn; |
| 6 | 6 | ||
| 7 | pub fn main() !void { | 7 | pub fn main() !void { |
| 8 | var ok_count: usize = 0; | ||
| 9 | var skip_count: usize = 0; | ||
| 8 | for (test_fn_list) |test_fn, i| { | 10 | for (test_fn_list) |test_fn, i| { |
| 9 | warn("Test {}/{} {}...", i + 1, test_fn_list.len, test_fn.name); | 11 | warn("Test {}/{} {}...", i + 1, test_fn_list.len, test_fn.name); |
| 10 | 12 | ||
| 11 | try test_fn.func(); | 13 | if (test_fn.func()) |_| { |
| 12 | 14 | ok_count += 1; | |
| 13 | warn("OK\n"); | 15 | warn("OK\n"); |
| 16 | } else |err| switch (err) { | ||
| 17 | error.SkipZigTest => { | ||
| 18 | skip_count += 1; | ||
| 19 | warn("SKIP\n"); | ||
| 20 | }, | ||
| 21 | else => return err, | ||
| 22 | } | ||
| 23 | } | ||
| 24 | if (ok_count == test_fn_list.len) { | ||
| 25 | warn("All tests passed.\n"); | ||
| 26 | } else { | ||
| 27 | warn("{} passed; {} skipped.\n", ok_count, skip_count); | ||
| 14 | } | 28 | } |
| 15 | } | 29 | } |