mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +00:00
test runner: handle start_fuzzing message
This commit is contained in:
parent
bce3b1efb0
commit
7366b4b9e2
@ -128,6 +128,28 @@ fn mainServer() !void {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
.start_fuzzing => {
|
||||||
|
const index = try server.receiveBody_u32();
|
||||||
|
const test_fn = builtin.test_functions[index];
|
||||||
|
while (true) {
|
||||||
|
testing.allocator_instance = .{};
|
||||||
|
defer if (testing.allocator_instance.deinit() == .leak) std.process.exit(1);
|
||||||
|
log_err_count = 0;
|
||||||
|
is_fuzz_test = false;
|
||||||
|
test_fn.func() catch |err| switch (err) {
|
||||||
|
error.SkipZigTest => continue,
|
||||||
|
else => {
|
||||||
|
if (@errorReturnTrace()) |trace| {
|
||||||
|
std.debug.dumpStackTrace(trace.*);
|
||||||
|
}
|
||||||
|
std.debug.print("failed with error.{s}\n", .{@errorName(err)});
|
||||||
|
std.process.exit(1);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
if (!is_fuzz_test) @panic("missed call to std.testing.fuzzInput");
|
||||||
|
if (log_err_count != 0) @panic("error logs detected");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
else => {
|
else => {
|
||||||
std.debug.print("unsupported message: {x}\n", .{@intFromEnum(hdr.tag)});
|
std.debug.print("unsupported message: {x}\n", .{@intFromEnum(hdr.tag)});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user