| ... | @@ -9,6 +9,7 @@ const std = @import("../../std.zig"); | ... | @@ -9,6 +9,7 @@ const std = @import("../../std.zig"); |
| 9 | const os = std.os; | 9 | const os = std.os; |
| 10 | const fmt = std.fmt; | 10 | const fmt = std.fmt; |
| 11 | const mem = std.mem; | 11 | const mem = std.mem; |
| | 12 | const builtin = std.builtin; |
| 12 | const testing = std.testing; | 13 | const testing = std.testing; |
| 13 | | 14 | |
| 14 | const IPv4 = std.x.os.IPv4; | 15 | const 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 | }; |
| 317 | | 318 | |
| 318 | test { | | |
| 319 | testing.refAllDecls(@This()); | | |
| 320 | } | | |
| 321 | | | |
| 322 | test "tcp: create non-blocking pair" { | 319 | test "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(); |
| 325 | | 324 | |
| ... | @@ -339,6 +338,8 @@ test "tcp: create non-blocking pair" { | ... | @@ -339,6 +338,8 @@ test "tcp: create non-blocking pair" { |
| 339 | } | 338 | } |
| 340 | | 339 | |
| 341 | test "tcp/client: set read timeout of 1 millisecond on blocking client" { | 340 | test "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(); |
| 344 | | 345 | |
| ... | @@ -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 | } |
| 362 | | 363 | |
| 363 | test "tcp/listener: bind to unspecified ipv4 address" { | 364 | test "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(); |
| 366 | | 369 | |
| ... | @@ -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 | } |
| 373 | | 376 | |
| 374 | test "tcp/listener: bind to unspecified ipv6 address" { | 377 | test "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(); |
| 377 | | 382 | |