This addresses #4307. For the static API we generate 100 arbitrary test cases at build time, each of which includes 0-5 parameter types, a result type, and a WAT fragment containing an imported function and an exported function. The exported function calls the imported function, which is implemented by the host. At runtime, the fuzz test selects a test case at random and feeds it zero or more sets of arbitrary parameters and results, checking that values which flow host-to-guest and guest-to-host make the transition unchanged. The fuzz test for the dynamic API follows a similar pattern, the only difference being that test cases are generated at runtime. Signed-off-by: Joel Dice <joel.dice@fermyon.com>
49 lines
1.7 KiB
TOML
49 lines
1.7 KiB
TOML
[package]
|
|
authors = ["The Wasmtime Project Developers"]
|
|
description = "Fuzzing infrastructure for Wasmtime"
|
|
edition = "2021"
|
|
name = "wasmtime-fuzzing"
|
|
publish = false
|
|
version = "0.19.0"
|
|
license = "Apache-2.0 WITH LLVM-exception"
|
|
|
|
[dependencies]
|
|
anyhow = "1.0.22"
|
|
arbitrary = { version = "1.1.0", features = ["derive"] }
|
|
component-test-util = { path = "../misc/component-test-util" }
|
|
component-fuzz-util = { path = "../misc/component-fuzz-util" }
|
|
env_logger = "0.9.0"
|
|
log = "0.4.8"
|
|
rayon = "1.2.1"
|
|
target-lexicon = "0.12.3"
|
|
tempfile = "3.3.0"
|
|
wasmparser = "0.88.0"
|
|
wasmprinter = "0.2.38"
|
|
wasmtime = { path = "../wasmtime" }
|
|
wasmtime-wast = { path = "../wast" }
|
|
wasm-encoder = "0.15.0"
|
|
wasm-smith = "0.11.3"
|
|
wasm-mutate = "0.2.6"
|
|
wasm-spec-interpreter = { path = "./wasm-spec-interpreter", optional = true }
|
|
wasmi = "0.11.0"
|
|
|
|
# We rely on precompiled v8 binaries, but rusty-v8 doesn't have a precompiled
|
|
# binary for MinGW which is built on our CI. It does have one for Windows-msvc,
|
|
# though, so we could use that if we wanted. For now though just simplify a bit
|
|
# and don't depend on this on Windows. The same applies on s390x.
|
|
[target.'cfg(not(any(windows, target_arch = "s390x")))'.dependencies]
|
|
v8 = "0.44.3"
|
|
|
|
[dev-dependencies]
|
|
wat = "1.0.47"
|
|
rand = { version = "0.8.0", features = ["small_rng"] }
|
|
|
|
# Only enable the `build-libinterpret` feature when fuzzing is enabled, enabling
|
|
# commands like `cargo test --workspace` or similar to not need an ocaml
|
|
# installation and only fuzzers need it by default.
|
|
[target.'cfg(fuzzing)'.dependencies]
|
|
wasm-spec-interpreter = { path = "./wasm-spec-interpreter", optional = true, features = ['build-libinterpret'] }
|
|
|
|
[features]
|
|
fuzz-spec-interpreter = ['wasm-spec-interpreter']
|