peepmatic: Define fuzz targets for various parts of peepmatic

This commit is contained in:
Nick Fitzgerald
2020-05-01 16:17:43 -07:00
parent 1a7670f964
commit 4b16a4ad85
6 changed files with 70 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ cranelift-reader = { path = "../cranelift/reader" }
cranelift-wasm = { path = "../cranelift/wasm" } cranelift-wasm = { path = "../cranelift/wasm" }
libfuzzer-sys = "0.3.2" libfuzzer-sys = "0.3.2"
target-lexicon = "0.10" target-lexicon = "0.10"
peepmatic-fuzzing = { path = "../cranelift/peepmatic/crates/fuzzing" }
wasmtime = { path = "../crates/wasmtime" } wasmtime = { path = "../crates/wasmtime" }
wasmtime-fuzzing = { path = "../crates/fuzzing" } wasmtime-fuzzing = { path = "../crates/fuzzing" }
@@ -56,5 +57,35 @@ path = "fuzz_targets/spectests.rs"
test = false test = false
doc = false doc = false
[[bin]]
name = "peepmatic_simple_automata"
path = "fuzz_targets/peepmatic_simple_automata.rs"
test = false
doc = false
[[bin]]
name = "peepmatic_fst_differential"
path = "fuzz_targets/peepmatic_fst_differential.rs"
test = false
doc = false
[[bin]]
name = "peepmatic_parser"
path = "fuzz_targets/peepmatic_parser.rs"
test = false
doc = false
[[bin]]
name = "peepmatic_compile"
path = "fuzz_targets/peepmatic_compile.rs"
test = false
doc = false
[[bin]]
name = "peepmatic_interp"
path = "fuzz_targets/peepmatic_interp.rs"
test = false
doc = false
[features] [features]
binaryen = ['wasmtime-fuzzing/binaryen'] binaryen = ['wasmtime-fuzzing/binaryen']

View File

@@ -0,0 +1,8 @@
#![no_main]
use libfuzzer_sys::fuzz_target;
use peepmatic_fuzzing::compile::compile;
fuzz_target!(|data: &[u8]| {
compile(data);
});

View File

@@ -0,0 +1,8 @@
#![no_main]
use libfuzzer_sys::fuzz_target;
use peepmatic_fuzzing::automata::fst_differential;
use std::collections::HashMap;
fuzz_target!(|map: HashMap<Vec<u8>, u64>| {
fst_differential(map);
});

View File

@@ -0,0 +1,8 @@
#![no_main]
use libfuzzer_sys::fuzz_target;
use peepmatic_fuzzing::interp::interp;
fuzz_target!(|data: &[u8]| {
interp(data);
});

View File

@@ -0,0 +1,8 @@
#![no_main]
use libfuzzer_sys::fuzz_target;
use peepmatic_fuzzing::parser::parse;
fuzz_target!(|data: &[u8]| {
parse(data);
});

View File

@@ -0,0 +1,7 @@
#![no_main]
use libfuzzer_sys::fuzz_target;
use peepmatic_fuzzing::automata::simple_automata;
fuzz_target!(|input_output_pairs: Vec<Vec<(u8, Vec<u8>)>>| {
simple_automata(input_output_pairs);
});