aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Build/Fuzz
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-09-09 19:36:52 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-09-11 13:41:29 -0700
commit892ce7ef527c863d84f3085f79f1a5aec7161c2c (patch)
tree7b7d2b934bcf59666e535fdc1df3a54bef8a9e53 /lib/std/Build/Fuzz
parent218cf059dd215282aa96d6b4715e68d533a4238e (diff)
downloadzig-892ce7ef527c863d84f3085f79f1a5aec7161c2c.tar.gz
zig-892ce7ef527c863d84f3085f79f1a5aec7161c2c.zip
rework fuzzing API
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.
Diffstat (limited to 'lib/std/Build/Fuzz')
0 files changed, 0 insertions, 0 deletions