Files
wasmtime/crates/fuzzing/src/generators.rs
Andrew Brown a8ce7f123b fuzz: add a single instruction module generator (#4409)
* fuzz: add a single instruction module generator

As proposed by @cfallin in #3251, this change adds a way to generate a
Wasm module for a single instruction. It captures the necessary
parameter and result types so that fuzzing can not only choose which
instruction to check but also generate values to pass to the
instruction. Not all instructions are available yet, but a significant
portion of scalar instructions are implemented in this change.

This does not wire the generator up to any fuzz targets.

* review: use raw string in test

* review: remove once_cell, use slices

* review: refactor macros to use valtype!

* review: avoid cloning when choosing a SingleInstModule
2022-07-07 22:50:59 +00:00

30 lines
991 B
Rust

//! Test case generators.
//!
//! Test case generators take raw, unstructured input from a fuzzer
//! (e.g. libFuzzer) and translate that into a structured test case (e.g. a
//! valid Wasm binary).
//!
//! These are generally implementations of the `Arbitrary` trait, or some
//! wrapper over an external tool, such that the wrapper implements the
//! `Arbitrary` trait for the wrapped external tool.
pub mod api;
mod codegen_settings;
mod config;
mod instance_allocation_strategy;
mod instance_limits;
mod memory;
mod module_config;
mod single_inst_module;
mod spec_test;
pub mod table_ops;
pub use codegen_settings::CodegenSettings;
pub use config::{Config, WasmtimeConfig};
pub use instance_allocation_strategy::InstanceAllocationStrategy;
pub use instance_limits::InstanceLimits;
pub use memory::{MemoryConfig, NormalMemoryConfig, UnalignedMemory, UnalignedMemoryCreator};
pub use module_config::ModuleConfig;
pub use single_inst_module::SingleInstModule;
pub use spec_test::SpecTest;