OSS-Fuzz integration (#1930)

This commit is contained in:
Zac Hatfield-Dodds 2021-01-16 11:05:15 +11:00 committed by GitHub
parent e8aadedd97
commit de510478d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

13
fuzz.py
View File

@ -56,4 +56,17 @@ def test_idempotent_any_syntatically_valid_python(
if __name__ == "__main__":
# Run tests, including shrinking and reporting any known failures.
test_idempotent_any_syntatically_valid_python()
# If Atheris is available, run coverage-guided fuzzing.
# (if you want only bounded fuzzing, just use `pytest fuzz.py`)
try:
import sys
import atheris
except ImportError:
pass
else:
test = test_idempotent_any_syntatically_valid_python
atheris.Setup(sys.argv, test.hypothesis.fuzz_one_input)
atheris.Fuzz()