mirror of
https://github.com/ziglang/zig.git
synced 2024-12-04 02:48:50 +00:00
892ce7ef52
The previous API used `std.testing.fuzzInput(.{})` however that has the problem that users call it multiple times incorrectly, and there might be work happening to obtain the corpus which should not be included in coverage analysis, and which must not slow down iteration speed. This commit restructures it so that the main loop lives in libfuzzer and directly calls the "test one" function. In this commit I was a little too aggressive because I made the test runner export `fuzzer_one` for this purpose. This was motivated by performance, but it causes "exported symbol collision: fuzzer_one" to occur when more than one fuzz test is provided. There are three ways to solve this: 1. libfuzzer needs to be passed a function pointer instead. Possible performance downside. 2. build runner needs to build a different process per fuzz test. Potentially wasteful and unclear how to isolate them. 3. test runner needs to perform a relocation at runtime to point the function call to the relevant unit test. Portability issues and dubious performance gains. |
||
---|---|---|
.. | ||
aro | ||
aro_translate_c | ||
reduce | ||
resinator | ||
aro_translate_c.zig | ||
build_runner.zig | ||
fmt.zig | ||
libc.zig | ||
objcopy.zig | ||
reduce.zig | ||
std-docs.zig | ||
test_runner.zig |