Add a spec test fuzzer for Config (#1509)

* Add a spec test fuzzer for Config

This commit adds a new fuzzer which is intended to run on oss-fuzz. This
fuzzer creates and arbitrary `Config` which *should* pass spec tests and
then asserts that it does so. The goal here is to weed out any
accidental bugs in global configuration which could cause
non-spec-compliant behavior.

* Move implementation to `fuzzing` crate
This commit is contained in:
Alex Crichton
2020-04-15 08:29:12 -05:00
committed by GitHub
parent be85242a3f
commit 6dde222992
7 changed files with 118 additions and 9 deletions

View File

@@ -50,5 +50,11 @@ test = false
doc = false
required-features = ['binaryen']
[[bin]]
name = "spectests"
path = "fuzz_targets/spectests.rs"
test = false
doc = false
[features]
binaryen = ['wasmtime-fuzzing/binaryen']

View File

@@ -0,0 +1,9 @@
#![no_main]
use libfuzzer_sys::fuzz_target;
use wasmtime_fuzzing::generators::{Config, SpecTest};
fuzz_target!(|pair: (Config, SpecTest)| {
let (config, test) = pair;
wasmtime_fuzzing::oracles::spectest(config, test);
});