| author | |
| committer | |
| log | 5b10d9f917ac773ca7c842d74ef44c861484670f |
| tree | c7d02b0f0c67f8f933ff66e88f62f476af5841ca |
| parent | 6ae36807b70e741ac1a7f8ee1b8d90466abfdda8 |
| signature |
5 files changed, 13 insertions(+), 17 deletions(-)
lib/std/event/channel.zig+3-4| ... | @@ -267,17 +267,16 @@ pub fn Channel(comptime T: type) type { | ... | @@ -267,17 +267,16 @@ pub fn Channel(comptime T: type) type { |
| 267 | } | 267 | } |
| 268 | 268 | ||
| 269 | test "std.event.Channel" { | 269 | test "std.event.Channel" { |
| 270 | if (!std.io.is_async) return error.SkipZigTest; | ||
| 271 | |||
| 270 | // https://github.com/ziglang/zig/issues/1908 | 272 | // https://github.com/ziglang/zig/issues/1908 |
| 271 | if (builtin.single_threaded) return error.SkipZigTest; | 273 | if (builtin.single_threaded) return error.SkipZigTest; |
| 272 | 274 | ||
| 273 | // https://github.com/ziglang/zig/issues/3251 | 275 | // https://github.com/ziglang/zig/issues/3251 |
| 274 | if (builtin.os == .freebsd) return error.SkipZigTest; | 276 | if (builtin.os == .freebsd) return error.SkipZigTest; |
| 275 | 277 | ||
| 276 | // TODO provide a way to run tests in evented I/O mode | ||
| 277 | if (!std.io.is_async) return error.SkipZigTest; | ||
| 278 | |||
| 279 | var channel: Channel(i32) = undefined; | 278 | var channel: Channel(i32) = undefined; |
| 280 | channel.init([0]i32{}); | 279 | channel.init(&[0]i32{}); |
| 281 | defer channel.deinit(); | 280 | defer channel.deinit(); |
| 282 | 281 | ||
| 283 | var handle = async testChannelGetter(&channel); | 282 | var handle = async testChannelGetter(&channel); |
lib/std/event/group.zig+1-1| ... | @@ -22,7 +22,7 @@ pub fn Group(comptime ReturnType: type) type { | ... | @@ -22,7 +22,7 @@ pub fn Group(comptime ReturnType: type) type { |
| 22 | const AllocStack = std.atomic.Stack(Node); | 22 | const AllocStack = std.atomic.Stack(Node); |
| 23 | 23 | ||
| 24 | pub const Node = struct { | 24 | pub const Node = struct { |
| 25 | bytes: []const u8 = [0]u8{}, | 25 | bytes: []const u8 = &[0]u8{}, |
| 26 | handle: anyframe->ReturnType, | 26 | handle: anyframe->ReturnType, |
| 27 | }; | 27 | }; |
| 28 | 28 |
lib/std/event/lock.zig+4-4| ... | @@ -117,21 +117,21 @@ pub const Lock = struct { | ... | @@ -117,21 +117,21 @@ pub const Lock = struct { |
| 117 | }; | 117 | }; |
| 118 | 118 | ||
| 119 | test "std.event.Lock" { | 119 | test "std.event.Lock" { |
| 120 | if (!std.io.is_async) return error.SkipZigTest; | ||
| 121 | |||
| 120 | // TODO https://github.com/ziglang/zig/issues/1908 | 122 | // TODO https://github.com/ziglang/zig/issues/1908 |
| 121 | if (builtin.single_threaded) return error.SkipZigTest; | 123 | if (builtin.single_threaded) return error.SkipZigTest; |
| 122 | 124 | ||
| 123 | // TODO https://github.com/ziglang/zig/issues/3251 | 125 | // TODO https://github.com/ziglang/zig/issues/3251 |
| 124 | if (builtin.os == .freebsd) return error.SkipZigTest; | 126 | if (builtin.os == .freebsd) return error.SkipZigTest; |
| 125 | 127 | ||
| 126 | // TODO provide a way to run tests in evented I/O mode | ||
| 127 | if (!std.io.is_async) return error.SkipZigTest; | ||
| 128 | |||
| 129 | var lock = Lock.init(); | 128 | var lock = Lock.init(); |
| 130 | defer lock.deinit(); | 129 | defer lock.deinit(); |
| 131 | 130 | ||
| 132 | _ = async testLock(&lock); | 131 | _ = async testLock(&lock); |
| 133 | 132 | ||
| 134 | testing.expectEqualSlices(i32, [1]i32{3 * @intCast(i32, shared_test_data.len)} ** shared_test_data.len, shared_test_data); | 133 | const expected_result = [1]i32{3 * @intCast(i32, shared_test_data.len)} ** shared_test_data.len; |
| 134 | testing.expectEqualSlices(i32, &expected_result, &shared_test_data); | ||
| 135 | } | 135 | } |
| 136 | 136 | ||
| 137 | async fn testLock(lock: *Lock) void { | 137 | async fn testLock(lock: *Lock) void { |
lib/std/fs/watch.zig+2-3| ... | @@ -615,12 +615,11 @@ pub fn Watch(comptime V: type) type { | ... | @@ -615,12 +615,11 @@ pub fn Watch(comptime V: type) type { |
| 615 | const test_tmp_dir = "std_event_fs_test"; | 615 | const test_tmp_dir = "std_event_fs_test"; |
| 616 | 616 | ||
| 617 | test "write a file, watch it, write it again" { | 617 | test "write a file, watch it, write it again" { |
| 618 | // TODO provide a way to run tests in evented I/O mode | 618 | // TODO re-enable this test |
| 619 | if (!std.io.is_async) return error.SkipZigTest; | 619 | if (true) return error.SkipZigTest; |
| 620 | 620 | ||
| 621 | const allocator = std.heap.page_allocator; | 621 | const allocator = std.heap.page_allocator; |
| 622 | 622 | ||
| 623 | // TODO move this into event loop too | ||
| 624 | try os.makePath(allocator, test_tmp_dir); | 623 | try os.makePath(allocator, test_tmp_dir); |
| 625 | defer os.deleteTree(test_tmp_dir) catch {}; | 624 | defer os.deleteTree(test_tmp_dir) catch {}; |
| 626 | 625 |
lib/std/net/test.zig+3-5| ... | @@ -81,17 +81,15 @@ test "resolve DNS" { | ... | @@ -81,17 +81,15 @@ test "resolve DNS" { |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | test "listen on a port, send bytes, receive bytes" { | 83 | test "listen on a port, send bytes, receive bytes" { |
| 84 | if (!std.io.is_async) return error.SkipZigTest; | ||
| 85 | |||
| 84 | if (std.builtin.os != .linux) { | 86 | if (std.builtin.os != .linux) { |
| 85 | // TODO build abstractions for other operating systems | 87 | // TODO build abstractions for other operating systems |
| 86 | return error.SkipZigTest; | 88 | return error.SkipZigTest; |
| 87 | } | 89 | } |
| 88 | if (std.io.mode != .evented) { | ||
| 89 | // TODO add ability to run tests in non-blocking I/O mode | ||
| 90 | return error.SkipZigTest; | ||
| 91 | } | ||
| 92 | 90 | ||
| 93 | // TODO doing this at comptime crashed the compiler | 91 | // TODO doing this at comptime crashed the compiler |
| 94 | const localhost = net.Address.parseIp("127.0.0.1", 0); | 92 | const localhost = try net.Address.parseIp("127.0.0.1", 0); |
| 95 | 93 | ||
| 96 | var server = net.StreamServer.init(net.StreamServer.Options{}); | 94 | var server = net.StreamServer.init(net.StreamServer.Options{}); |
| 97 | defer server.deinit(); | 95 | defer server.deinit(); |