Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port fuzz testing to Go 1.18 native fuzzing #508

merged 3 commits into from Jun 21, 2022

Port fuzz testing to Go 1.18 native fuzzing #508

merged 3 commits into from Jun 21, 2022


Copy link

@kmoe kmoe commented Jan 20, 2022

Go 1.18, due to be released in February 2022, adds built-in fuzz testing capabilities. Please see the latest documentation at (note that the corpus directory structure has changed somewhat since the initial proposal and implementation).

This PR ports @alisdair's work on fuzz testing from the go-fuzz library to the new native fuzzing. Once this is merged, oss-fuzz and internal fuzzing efforts will be updated.

The main changes this PR makes are:

  • Seed corpus files are converted to the new Go 1.18 fuzz corpus file format
  • Directory structure is updated
    • Seed corpus files live in testdata/fuzz/<fuzz test name>
    • Fuzz tests for the same package are consolidated into one fuzz_test.go
  • Fuzz tests are updated to use testing.F
  • READMEs updated

Tests will fail until this repo's CI uses Go 1.18. To test this PR, you can use gotip, or just wait until Go 1.18 is released.

@kmoe kmoe requested a review from a team Jan 20, 2022
Copy link

@alisdair alisdair left a comment

Thanks for doing this!

hclsyntax/fuzz/ Outdated Show resolved Hide resolved
Copy link

hashicorp-cla commented Mar 12, 2022

CLA assistant check
All committers have signed the CLA.

@kmoe kmoe merged commit 986b881 into main Jun 21, 2022
7 checks passed
@kmoe kmoe deleted the go118fuzz branch Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

3 participants