-
Notifications
You must be signed in to change notification settings - Fork 113
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
Combining fuzzer with test infrastructure #256
Comments
#[cfg(any(test, fuzzing))]
mod test_utils {
// ...
} |
Thanks a lot - that works smoothly! My follow-up is then about |
The best solution is to use a cargo feature to enable optional dependencies. |
Thanks a lot! |
@DavidKorczynski I wonder what the project you were working with was. Could you point me in the right direction? Assuming it had something to do with OSS-Fuzz I wonder if it is possible to update https://google.github.io/oss-fuzz/getting-started/new-project-guide/rust-lang/ so that it would be easier for new Rust projects to be integrated properly. Thanks! |
It was Linkerd2-proxy https://github.com/linkerd/linkerd2-proxy
Although the solution worked with #[cfg(fuzzing)]
pub mod fuzz_logic { and I would then simply call into these modules from my fuzzers. This meant the majority of the fuzzing logic is placed in the same files as the code they target while still keeping the fuzzers in separate folders. The only place I had to use I would be happy to update the OSS-Fuzz documentation. I think to keep things condensed, the most important bit to mention is that you can use the |
Hi,
I am working with a project where there is a large test infrastructure. I want to use utilities and helper functions from this testing infrastructure in my fuzzers, and I would also like to be able to build the fuzzers, i.e.
cargo +nightly fuzz build
. I am unsure how to do this - as the testing infrastructure only gets compiled when I runcargo test
. Is it possible to create a set up where the fuzzer can use the testing infrastructure which is guarded by#[cfg(test)]
anddev-dependencies
?The text was updated successfully, but these errors were encountered: