Add honggfuzz.
This commit is contained in:
parent
84a16a42f9
commit
fa7564692e
|
@ -0,0 +1,2 @@
|
||||||
|
hfuzz_workspace/
|
||||||
|
hfuzz_target/
|
|
@ -0,0 +1,9 @@
|
||||||
|
[package]
|
||||||
|
name = "hfuzz"
|
||||||
|
version = "0.1.0"
|
||||||
|
authors = ["Sergey Pepyakin <s.pepyakin@gmail.com>"]
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
honggfuzz = "0.5"
|
||||||
|
wasmi = { path = ".." }
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
#[test]
|
||||||
|
fn it_works() {
|
||||||
|
assert_eq!(2 + 2, 4);
|
||||||
|
}
|
||||||
|
}
|
|
@ -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]| {
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue