authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-02-23 02:29:02-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-02-23 02:37:11-07:00
logd7ac8c8e6552462d3e5e3b4ebce8a4e2ca93be76
treef7a02320c05d9a8811ac64788c769f2be59b9b4d
parent483b63d301315d6ca2c1c8660f5ec636c7358dc6

wasi: don't try to test http

wasi does not support networking

2 files changed, 7 insertions(+), 4 deletions(-)

lib/std/http.zig+6-3
...@@ -1,5 +1,3 @@...@@ -1,5 +1,3 @@
1const std = @import("std.zig");
2
3pub const Client = @import("http/Client.zig");1pub const Client = @import("http/Client.zig");
4pub const Server = @import("http/Server.zig");2pub const Server = @import("http/Server.zig");
5pub const protocol = @import("http/protocol.zig");3pub const protocol = @import("http/protocol.zig");
...@@ -308,6 +306,9 @@ pub const Header = struct {...@@ -308,6 +306,9 @@ pub const Header = struct {
308 value: []const u8,306 value: []const u8,
309};307};
310308
309const builtin = @import("builtin");
310const std = @import("std.zig");
311
311test {312test {
312 _ = Client;313 _ = Client;
313 _ = Method;314 _ = Method;
...@@ -315,5 +316,7 @@ test {...@@ -315,5 +316,7 @@ test {
315 _ = Status;316 _ = Status;
316 _ = HeadParser;317 _ = HeadParser;
317 _ = ChunkParser;318 _ = ChunkParser;
318 _ = @import("http/test.zig");319 if (builtin.os.tag != .wasi) {
320 _ = @import("http/test.zig");
321 }
319}322}
lib/std/http/test.zig+1-1
...@@ -914,6 +914,7 @@ const TestServer = struct {...@@ -914,6 +914,7 @@ const TestServer = struct {
914914
915 fn destroy(self: *@This()) void {915 fn destroy(self: *@This()) void {
916 self.server_thread.join();916 self.server_thread.join();
917 self.net_server.deinit();
917 std.testing.allocator.destroy(self);918 std.testing.allocator.destroy(self);
918 }919 }
919920
...@@ -924,7 +925,6 @@ const TestServer = struct {...@@ -924,7 +925,6 @@ const TestServer = struct {
924925
925fn createTestServer(S: type) !*TestServer {926fn createTestServer(S: type) !*TestServer {
926 if (builtin.single_threaded) return error.SkipZigTest;927 if (builtin.single_threaded) return error.SkipZigTest;
927 if (builtin.os.tag == .wasi) return error.SkipZigTest;
928 if (builtin.zig_backend == .stage2_llvm and native_endian == .big) {928 if (builtin.zig_backend == .stage2_llvm and native_endian == .big) {
929 // https://github.com/ziglang/zig/issues/13782929 // https://github.com/ziglang/zig/issues/13782
930 return error.SkipZigTest;930 return error.SkipZigTest;