From b5021411a84822cb3f1e3aeffad9550dd15bdeb6 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 16 Sep 2018 12:54:24 +0300 Subject: rename all things --- crates/ra_syntax/fuzz/.gitignore | 4 ++++ crates/ra_syntax/fuzz/Cargo.toml | 22 ++++++++++++++++++++++ crates/ra_syntax/fuzz/fuzz_targets/parser.rs | 9 +++++++++ 3 files changed, 35 insertions(+) create mode 100644 crates/ra_syntax/fuzz/.gitignore create mode 100644 crates/ra_syntax/fuzz/Cargo.toml create mode 100644 crates/ra_syntax/fuzz/fuzz_targets/parser.rs (limited to 'crates/ra_syntax/fuzz') diff --git a/crates/ra_syntax/fuzz/.gitignore b/crates/ra_syntax/fuzz/.gitignore new file mode 100644 index 000000000..572e03bdf --- /dev/null +++ b/crates/ra_syntax/fuzz/.gitignore @@ -0,0 +1,4 @@ + +target +corpus +artifacts diff --git a/crates/ra_syntax/fuzz/Cargo.toml b/crates/ra_syntax/fuzz/Cargo.toml new file mode 100644 index 000000000..65ded6a21 --- /dev/null +++ b/crates/ra_syntax/fuzz/Cargo.toml @@ -0,0 +1,22 @@ + +[package] +name = "ra_syntax-fuzz" +version = "0.0.1" +authors = ["Automatically generated"] +publish = false + +[package.metadata] +cargo-fuzz = true + +[dependencies.ra_syntax] +path = ".." +[dependencies.libfuzzer-sys] +git = "https://github.com/rust-fuzz/libfuzzer-sys.git" + +# Prevent this from interfering with workspaces +[workspace] +members = ["."] + +[[bin]] +name = "parser" +path = "fuzz_targets/parser.rs" diff --git a/crates/ra_syntax/fuzz/fuzz_targets/parser.rs b/crates/ra_syntax/fuzz/fuzz_targets/parser.rs new file mode 100644 index 000000000..396c0ecaf --- /dev/null +++ b/crates/ra_syntax/fuzz/fuzz_targets/parser.rs @@ -0,0 +1,9 @@ +#![no_main] +#[macro_use] extern crate libfuzzer_sys; +extern crate ra_syntax; + +fuzz_target!(|data: &[u8]| { + if let Ok(text) = std::str::from_utf8(data) { + ra_syntax::utils::check_fuzz_invariants(text) + } +}); -- cgit v1.2.3