aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/fuzz
diff options
context:
space:
mode:
authorpcpthm <[email protected]>2019-03-21 17:05:12 +0000
committerpcpthm <[email protected]>2019-03-21 23:04:48 +0000
commite734190c24d2a5aca5b62c2b1ab7e6136017a25c (patch)
tree106ca91f918767cdee896d879ece4930410b6ea7 /crates/ra_syntax/fuzz
parent51323a852a8979a71c21725b3b2771224132b85f (diff)
Refactor parser fuzz testing
Diffstat (limited to 'crates/ra_syntax/fuzz')
-rw-r--r--crates/ra_syntax/fuzz/Cargo.toml8
-rw-r--r--crates/ra_syntax/fuzz/fuzz_targets/parser.rs6
2 files changed, 7 insertions, 7 deletions
diff --git a/crates/ra_syntax/fuzz/Cargo.toml b/crates/ra_syntax/fuzz/Cargo.toml
index 4a255882e..c54d12813 100644
--- a/crates/ra_syntax/fuzz/Cargo.toml
+++ b/crates/ra_syntax/fuzz/Cargo.toml
@@ -4,14 +4,14 @@ name = "ra_syntax-fuzz"
4version = "0.0.1" 4version = "0.0.1"
5authors = ["rust-analyzer developers"] 5authors = ["rust-analyzer developers"]
6publish = false 6publish = false
7edition = "2018"
7 8
8[package.metadata] 9[package.metadata]
9cargo-fuzz = true 10cargo-fuzz = true
10 11
11[dependencies.ra_syntax] 12[dependencies]
12path = ".." 13ra_syntax = { path = ".." }
13[dependencies.libfuzzer-sys] 14libfuzzer-sys = { git = "https://github.com/rust-fuzz/libfuzzer-sys.git" }
14git = "https://github.com/rust-fuzz/libfuzzer-sys.git"
15 15
16# Prevent this from interfering with workspaces 16# Prevent this from interfering with workspaces
17[workspace] 17[workspace]
diff --git a/crates/ra_syntax/fuzz/fuzz_targets/parser.rs b/crates/ra_syntax/fuzz/fuzz_targets/parser.rs
index 4667d5579..76a8b08d0 100644
--- a/crates/ra_syntax/fuzz/fuzz_targets/parser.rs
+++ b/crates/ra_syntax/fuzz/fuzz_targets/parser.rs
@@ -1,9 +1,9 @@
1#![no_main] 1#![no_main]
2#[macro_use] extern crate libfuzzer_sys; 2use libfuzzer_sys::fuzz_target;
3extern crate ra_syntax; 3use ra_syntax::fuzz::check_parser;
4 4
5fuzz_target!(|data: &[u8]| { 5fuzz_target!(|data: &[u8]| {
6 if let Ok(text) = std::str::from_utf8(data) { 6 if let Ok(text) = std::str::from_utf8(data) {
7 ra_syntax::check_fuzz_invariants(text) 7 check_parser(text)
8 } 8 }
9}); 9});