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

Add fuzz test to ensure venial parses everything that syn does #4

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -4,3 +4,6 @@

# These are backup files generated by rustfmt
**/*.rs.bk

# Folder generated by fuzzcheck
/fuzz
247 changes: 241 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions Cargo.toml
Expand Up @@ -17,3 +17,16 @@ quote = "1.0.15"
[dev-dependencies]
insta = "1.12.0"
similar-asserts = "1.2.0"

# fuzzcheck and syn are heavy, so only import them when `cfg(fuzzing)` is set
[target.'cfg(fuzzing)'.dev-dependencies]
fuzzcheck = { git = "https://github.com/loiclec/fuzzcheck-rs", default-features = false }
fuzzcheck_proc_macro2 = { git = "https://github.com/loiclec/fuzzcheck_proc_macro2" }
syn = { version = "1.0.89", features = ["full", "visit"] }

# not stricly necessary, but it is good for the fuzzer to run as fast as possible
[profile.fuzzing]
inherits = "release"
codegen-units = 1
lto = "thin"
debug = false
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the fuzzing profile have debug = true instead, to catch more potential panics?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's correct. Not sure why it's set to false, I must have been experimenting with different values and then forgot to turn it back to true.