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>
29 lines
685 B
TOML
29 lines
685 B
TOML
[package]
|
|
name = "wasmtime-environ-fuzz"
|
|
version = "0.0.0"
|
|
authors = ["Automatically generated"]
|
|
publish = false
|
|
edition = "2018"
|
|
|
|
[package.metadata]
|
|
cargo-fuzz = true
|
|
|
|
[dependencies]
|
|
arbitrary = { version = "1.1.0", features = ["derive"] }
|
|
env_logger = "0.9.0"
|
|
libfuzzer-sys = "0.4"
|
|
wasmparser = "0.88.0"
|
|
wasmprinter = "0.2.37"
|
|
wasmtime-environ = { path = ".." }
|
|
component-fuzz-util = { path = "../../misc/component-fuzz-util", optional = true }
|
|
|
|
[[bin]]
|
|
name = "fact-valid-module"
|
|
path = "fuzz_targets/fact-valid-module.rs"
|
|
test = false
|
|
doc = false
|
|
required-features = ["component-model"]
|
|
|
|
[features]
|
|
component-model = ["wasmtime-environ/component-model", "dep:component-fuzz-util"]
|