Add honggfuzz.

This commit is contained in:
Sergey Pepyakin 2018-02-24 11:31:52 +00:00
parent 84a16a42f9
commit fa7564692e
4 changed files with 39 additions and 0 deletions

2
hfuzz/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
hfuzz_workspace/
hfuzz_target/

9
hfuzz/Cargo.toml Normal file
View File

@ -0,0 +1,9 @@
[package]
name = "hfuzz"
version = "0.1.0"
authors = ["Sergey Pepyakin <s.pepyakin@gmail.com>"]
[dependencies]
honggfuzz = "0.5"
wasmi = { path = ".." }

7
hfuzz/src/lib.rs Normal file
View File

@ -0,0 +1,7 @@
#[cfg(test)]
mod tests {
#[test]
fn it_works() {
assert_eq!(2 + 2, 4);
}
}

21
hfuzz/src/main.rs Normal file
View File

@ -0,0 +1,21 @@
#[macro_use] extern crate honggfuzz;
fn main() {
// Here you can parse `std::env::args and
// setup / initialize your project
// You have full control over the loop but
// you're supposed to call `fuzz` ad vitam aeternam
loop {
// The fuzz macro gives an arbitrary object (see `arbitrary crate`)
// to a closure-like block of code.
// For performance reasons, it is recommended that you use the native type
// `&[u8]` when possible.
// Here, this slice will contain a "random" quantity of "random" data.
fuzz!(|data: &[u8]| {
});
}
}