| ... | @@ -65,7 +65,7 @@ pub fn main(init: std.process.Init.Minimal) void { | ... | @@ -65,7 +65,7 @@ pub fn main(init: std.process.Init.Minimal) void { |
| 65 | } | 65 | } |
| 66 | | 66 | |
| 67 | if (listen) { | 67 | if (listen) { |
| 68 | return mainServer(init) catch @panic("internal test runner failure"); | 68 | return mainServer(init) catch |err| std.debug.panic("internal test runner failure: {t}", .{err}); |
| 69 | } else { | 69 | } else { |
| 70 | return mainTerminal(init); | 70 | return mainTerminal(init); |
| 71 | } | 71 | } |
| ... | @@ -75,24 +75,24 @@ fn mainServer(init: std.process.Init.Minimal) !void { | ... | @@ -75,24 +75,24 @@ fn mainServer(init: std.process.Init.Minimal) !void { |
| 75 | @disableInstrumentation(); | 75 | @disableInstrumentation(); |
| 76 | var stdin_reader = Io.File.stdin().readerStreaming(runner_threaded_io, &stdin_buffer); | 76 | var stdin_reader = Io.File.stdin().readerStreaming(runner_threaded_io, &stdin_buffer); |
| 77 | var stdout_writer = Io.File.stdout().writerStreaming(runner_threaded_io, &stdout_buffer); | 77 | var stdout_writer = Io.File.stdout().writerStreaming(runner_threaded_io, &stdout_buffer); |
| 78 | var server = try std.zig.Server.init(.{ | 78 | var server = std.zig.Server.init(.{ |
| 79 | .in = &stdin_reader.interface, | 79 | .in = &stdin_reader.interface, |
| 80 | .out = &stdout_writer.interface, | 80 | .out = &stdout_writer.interface, |
| 81 | .zig_version = builtin.zig_version_string, | 81 | .zig_version = builtin.zig_version_string, |
| 82 | }); | 82 | }) catch |err| std.debug.panic("failed to init Server: {t}", .{err}); |
| 83 | | 83 | |
| 84 | if (builtin.fuzz) { | 84 | if (builtin.fuzz) { |
| 85 | const coverage = fuzz_abi.fuzzer_coverage(); | 85 | const coverage = fuzz_abi.fuzzer_coverage(); |
| 86 | try server.serveCoverageIdMessage( | 86 | server.serveCoverageIdMessage( |
| 87 | coverage.id, | 87 | coverage.id, |
| 88 | coverage.runs, | 88 | coverage.runs, |
| 89 | coverage.unique, | 89 | coverage.unique, |
| 90 | coverage.seen, | 90 | coverage.seen, |
| 91 | ); | 91 | ) catch |err| std.debug.panic("failed to serveCoverageIdMessage: {t}", .{err}); |
| 92 | } | 92 | } |
| 93 | | 93 | |
| 94 | while (true) { | 94 | while (true) { |
| 95 | const hdr = try server.receiveMessage(); | 95 | const hdr = server.receiveMessage() catch |err| std.debug.panic("failed to receiveMessage: {t}", .{err}); |
| 96 | switch (hdr.tag) { | 96 | switch (hdr.tag) { |
| 97 | .exit => { | 97 | .exit => { |
| 98 | return std.process.exit(0); | 98 | return std.process.exit(0); |
| ... | @@ -121,11 +121,11 @@ fn mainServer(init: std.process.Init.Minimal) !void { | ... | @@ -121,11 +121,11 @@ fn mainServer(init: std.process.Init.Minimal) !void { |
| 121 | expected_panic_msg.* = 0; | 121 | expected_panic_msg.* = 0; |
| 122 | } | 122 | } |
| 123 | | 123 | |
| 124 | try server.serveTestMetadata(.{ | 124 | server.serveTestMetadata(.{ |
| 125 | .names = names, | 125 | .names = names, |
| 126 | .expected_panic_msgs = expected_panic_msgs, | 126 | .expected_panic_msgs = expected_panic_msgs, |
| 127 | .string_bytes = string_bytes.items, | 127 | .string_bytes = string_bytes.items, |
| 128 | }); | 128 | }) catch |err| std.debug.panic("failed to serveTestMetadata: {t}", .{err}); |
| 129 | }, | 129 | }, |
| 130 | | 130 | |
| 131 | .run_test => { | 131 | .run_test => { |
| ... | @@ -136,12 +136,12 @@ fn mainServer(init: std.process.Init.Minimal) !void { | ... | @@ -136,12 +136,12 @@ fn mainServer(init: std.process.Init.Minimal) !void { |
| 136 | .environ = init.environ, | 136 | .environ = init.environ, |
| 137 | }); | 137 | }); |
| 138 | log_err_count = 0; | 138 | log_err_count = 0; |
| 139 | const index = try server.receiveBody_u32(); | 139 | const index = server.receiveBody_u32() catch |err| std.debug.panic("failed to receiveBody_u32 test index: {t}", .{err}); |
| 140 | const test_fn = builtin.test_functions[index]; | 140 | const test_fn = builtin.test_functions[index]; |
| 141 | is_fuzz_test = false; | 141 | is_fuzz_test = false; |
| 142 | | 142 | |
| 143 | // let the build server know we're starting the test now | 143 | // let the build server know we're starting the test now |
| 144 | try server.serveStringMessage(.test_started, &.{}); | 144 | server.serveStringMessage(.test_started, &.{}) catch |err| std.debug.panic("failed to serveStringMessage: {t}", .{err}); |
| 145 | | 145 | |
| 146 | const TestResults = std.zig.Server.Message.TestResults; | 146 | const TestResults = std.zig.Server.Message.TestResults; |
| 147 | const status: TestResults.Status = if (test_fn.func()) |v| s: { | 147 | const status: TestResults.Status = if (test_fn.func()) |v| s: { |
| ... | @@ -159,7 +159,7 @@ fn mainServer(init: std.process.Init.Minimal) !void { | ... | @@ -159,7 +159,7 @@ fn mainServer(init: std.process.Init.Minimal) !void { |
| 159 | testing.io_instance.deinit(); | 159 | testing.io_instance.deinit(); |
| 160 | const leak_count = testing.allocator_instance.detectLeaks(); | 160 | const leak_count = testing.allocator_instance.detectLeaks(); |
| 161 | testing.allocator_instance.deinitWithoutLeakChecks(); | 161 | testing.allocator_instance.deinitWithoutLeakChecks(); |
| 162 | try server.serveTestResults(.{ | 162 | server.serveTestResults(.{ |
| 163 | .index = index, | 163 | .index = index, |
| 164 | .flags = .{ | 164 | .flags = .{ |
| 165 | .status = status, | 165 | .status = status, |
| ... | @@ -173,7 +173,7 @@ fn mainServer(init: std.process.Init.Minimal) !void { | ... | @@ -173,7 +173,7 @@ fn mainServer(init: std.process.Init.Minimal) !void { |
| 173 | leak_count, | 173 | leak_count, |
| 174 | ), | 174 | ), |
| 175 | }, | 175 | }, |
| 176 | }); | 176 | }) catch |err| std.debug.panic("failed to serveTestResults: {t}", .{err}); |
| 177 | }, | 177 | }, |
| 178 | .start_fuzzing => { | 178 | .start_fuzzing => { |
| 179 | // This ensures that this code won't be analyzed and hence reference fuzzer symbols | 179 | // This ensures that this code won't be analyzed and hence reference fuzzer symbols |