From 3679f64b08e430c50c59b5f41f70718cbc1b8eb0 Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Thu, 7 Sep 2017 13:06:50 -0700 Subject: [PATCH] add fuzzing instructions to README --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index da54066..8f7046c 100644 --- a/README.md +++ b/README.md @@ -23,12 +23,20 @@ println!("Function count in wasm file: {}", code_section.bodies().len()); ## Wabt Test suite -Interpreter and decoder supports full wabt testsuite (https://github.com/WebAssembly/testsuite), To run testsuite: +Interpreter and decoder supports full wabt testsuite (https://github.com/WebAssembly/testsuite), To run testsuite: - make sure you have all prerequisites to build `wabt` (since parity-wasm builds it internally using `cmake`, see https://github.com/WebAssembly/wabt) - checkout with submodules (`git submodule update --init --recurive`) - run `cargo test --release --manifest-path=spec/Cargo.toml` +Decoder can be fuzzed with `cargo-fuzz` using `wasm-opt` (https://githib.com/WebAssembly/binaryen): + +- make sure you have all prerequisites to build `binaryen` and `cargo-fuzz` (`cmake` and a C++11 toolchain) +- checkout with submodules (`git submodule update --init --recursive`) +- install `cargo fuzz` subcommand with `cargo install cargo-fuzz` +- set rustup to use a nightly toolchain, because `cargo fuzz` uses a rust compiler plugin: `rustup override set nightly` +- run `cargo fuzz run deserialize` + # License `parity-wasm` is primarily distributed under the terms of both the MIT