* cranelift: Initial fuzzer implementation * cranelift: Generate multiple test cases in fuzzer * cranelift: Separate function generator in fuzzer * cranelift: Insert random instructions in fuzzer * cranelift: Rename gen_testcase * cranelift: Implement div for unsigned values in interpreter * cranelift: Run all test cases in fuzzer * cranelift: Comment options in function_runner * cranelift: Improve fuzzgen README.md * cranelift: Fuzzgen remove unused variable * cranelift: Fuzzer code style fixes Thanks! @bjorn3 * cranelift: Fix nits in CLIF fuzzer Thanks @cfallin! * cranelift: Implement Arbitrary for TestCase * cranelift: Remove gen_testcase * cranelift: Move fuzzers to wasmtime fuzz directory * cranelift: CLIF-Fuzzer ignore tests that produce traps * cranelift: CLIF-Fuzzer create new fuzz target to validate generated testcases * cranelift: Store clif-fuzzer config in a separate struct * cranelift: Generate variables upfront per function * cranelift: Prevent publishing of fuzzgen crate
25 lines
785 B
Rust
25 lines
785 B
Rust
use std::ops::RangeInclusive;
|
|
|
|
/// Holds the range of acceptable values to use during the generation of testcases
|
|
pub struct Config {
|
|
pub test_case_inputs: RangeInclusive<usize>,
|
|
pub signature_params: RangeInclusive<usize>,
|
|
pub signature_rets: RangeInclusive<usize>,
|
|
pub instructions_per_block: RangeInclusive<usize>,
|
|
/// Number of variables that we allocate per function
|
|
/// This value does not include the signature params
|
|
pub vars_per_function: RangeInclusive<usize>,
|
|
}
|
|
|
|
impl Default for Config {
|
|
fn default() -> Self {
|
|
Config {
|
|
test_case_inputs: 1..=10,
|
|
signature_params: 0..=16,
|
|
signature_rets: 0..=16,
|
|
instructions_per_block: 0..=64,
|
|
vars_per_function: 0..=16,
|
|
}
|
|
}
|
|
}
|