| ... | @@ -128,6 +128,28 @@ fn mainServer() !void { | ... | @@ -128,6 +128,28 @@ fn mainServer() !void { |
| 128 | }, | 128 | }, |
| 129 | }); | 129 | }); |
| 130 | }, | 130 | }, |
| | 131 | .start_fuzzing => { |
| | 132 | const index = try server.receiveBody_u32(); |
| | 133 | const test_fn = builtin.test_functions[index]; |
| | 134 | while (true) { |
| | 135 | testing.allocator_instance = .{}; |
| | 136 | defer if (testing.allocator_instance.deinit() == .leak) std.process.exit(1); |
| | 137 | log_err_count = 0; |
| | 138 | is_fuzz_test = false; |
| | 139 | test_fn.func() catch |err| switch (err) { |
| | 140 | error.SkipZigTest => continue, |
| | 141 | else => { |
| | 142 | if (@errorReturnTrace()) |trace| { |
| | 143 | std.debug.dumpStackTrace(trace.*); |
| | 144 | } |
| | 145 | std.debug.print("failed with error.{s}\n", .{@errorName(err)}); |
| | 146 | std.process.exit(1); |
| | 147 | }, |
| | 148 | }; |
| | 149 | if (!is_fuzz_test) @panic("missed call to std.testing.fuzzInput"); |
| | 150 | if (log_err_count != 0) @panic("error logs detected"); |
| | 151 | } |
| | 152 | }, |
| 131 | | 153 | |
| 132 | else => { | 154 | else => { |
| 133 | std.debug.print("unsupported message: {x}\n", .{@intFromEnum(hdr.tag)}); | 155 | std.debug.print("unsupported message: {x}\n", .{@intFromEnum(hdr.tag)}); |