authorgravatar for kenta@lithdew.netlithdew <kenta@lithdew.net> 2021-04-30 22:09:12+09:00
committergravatar for kenta@lithdew.netlithdew <kenta@lithdew.net> 2021-05-03 14:49:10+09:00
log9a7c57144da9057c80059a3a1ec37aec44dcdc7a
tree618e795615d9d438659b819a92b98ffe9089293a
parent8ef9d98e6dd24bf9c3def1e938e3eab66b39667c

x/net: disable tcp tests on wasi


1 files changed, 9 insertions(+), 4 deletions(-)

lib/std/x/net/tcp.zig+9-4
...@@ -9,6 +9,7 @@ const std = @import("../../std.zig");...@@ -9,6 +9,7 @@ const std = @import("../../std.zig");
9const os = std.os;9const os = std.os;
10const fmt = std.fmt;10const fmt = std.fmt;
11const mem = std.mem;11const mem = std.mem;
12const builtin = std.builtin;
12const testing = std.testing;13const testing = std.testing;
1314
14const IPv4 = std.x.os.IPv4;15const IPv4 = std.x.os.IPv4;
...@@ -315,11 +316,9 @@ pub const Listener = struct {...@@ -315,11 +316,9 @@ pub const Listener = struct {
315 }316 }
316};317};
317318
318test {
319 testing.refAllDecls(@This());
320}
321
322test "tcp: create non-blocking pair" {319test "tcp: create non-blocking pair" {
320 if (builtin.os.tag == .wasi) return error.SkipZigTest;
321
323 const listener = try tcp.Listener.init(.ip, os.SOCK_NONBLOCK | os.SOCK_CLOEXEC);322 const listener = try tcp.Listener.init(.ip, os.SOCK_NONBLOCK | os.SOCK_CLOEXEC);
324 defer listener.deinit();323 defer listener.deinit();
325324
...@@ -339,6 +338,8 @@ test "tcp: create non-blocking pair" {...@@ -339,6 +338,8 @@ test "tcp: create non-blocking pair" {
339}338}
340339
341test "tcp/client: set read timeout of 1 millisecond on blocking client" {340test "tcp/client: set read timeout of 1 millisecond on blocking client" {
341 if (builtin.os.tag == .wasi) return error.SkipZigTest;
342
342 const listener = try tcp.Listener.init(.ip, os.SOCK_CLOEXEC);343 const listener = try tcp.Listener.init(.ip, os.SOCK_CLOEXEC);
343 defer listener.deinit();344 defer listener.deinit();
344345
...@@ -361,6 +362,8 @@ test "tcp/client: set read timeout of 1 millisecond on blocking client" {...@@ -361,6 +362,8 @@ test "tcp/client: set read timeout of 1 millisecond on blocking client" {
361}362}
362363
363test "tcp/listener: bind to unspecified ipv4 address" {364test "tcp/listener: bind to unspecified ipv4 address" {
365 if (builtin.os.tag == .wasi) return error.SkipZigTest;
366
364 const listener = try tcp.Listener.init(.ip, os.SOCK_CLOEXEC);367 const listener = try tcp.Listener.init(.ip, os.SOCK_CLOEXEC);
365 defer listener.deinit();368 defer listener.deinit();
366369
...@@ -372,6 +375,8 @@ test "tcp/listener: bind to unspecified ipv4 address" {...@@ -372,6 +375,8 @@ test "tcp/listener: bind to unspecified ipv4 address" {
372}375}
373376
374test "tcp/listener: bind to unspecified ipv6 address" {377test "tcp/listener: bind to unspecified ipv6 address" {
378 if (builtin.os.tag == .wasi) return error.SkipZigTest;
379
375 const listener = try tcp.Listener.init(.ipv6, os.SOCK_CLOEXEC);380 const listener = try tcp.Listener.init(.ipv6, os.SOCK_CLOEXEC);
376 defer listener.deinit();381 defer listener.deinit();
377382