-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fuzzing: Move to an iterator pattern for input.
Previously, the `std.testing.fuzzInput` interface was called once for a given test function. This had the downside that the test functions were unable to initialize state independent of the fuzz loop. Now, `std.testing.fuzzInput` has been replaced with `std.testing.fuzzer` which returns a `std.testing.Fuzzer`. To receive fuzz input, the function must loop on the `std.testing.Fuzzer.next` function, retrieving one `std.testing.Fuzzer.Run` at a time. That run object contains a reference to a per-loop allocator and the fuzz input for that loop. Additionally, with the ability to accept multiple fuzz inputs within the test function, the corpus provided to `std.testing.fuzzer` is now used to dry-run the test will all the provided inputs. In a future commit, this may also be used to seed the fuzzer.
- Loading branch information
Showing
4 changed files
with
149 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters