implement fuzzing for component types (#4537)
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>
This commit is contained in:
14
crates/misc/component-fuzz-util/Cargo.toml
Normal file
14
crates/misc/component-fuzz-util/Cargo.toml
Normal file
@@ -0,0 +1,14 @@
|
||||
[package]
|
||||
name = "component-fuzz-util"
|
||||
authors = ["The Wasmtime Project Developers"]
|
||||
license = "Apache-2.0 WITH LLVM-exception"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
publish = false
|
||||
|
||||
[dependencies]
|
||||
anyhow = { version = "1.0.19" }
|
||||
arbitrary = { version = "1.1.0", features = ["derive"] }
|
||||
proc-macro2 = "1.0"
|
||||
quote = "1.0"
|
||||
wasmtime-component-util = { path = "../../component-util" }
|
||||
Reference in New Issue
Block a user