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, pub signature_params: RangeInclusive, pub signature_rets: RangeInclusive, pub instructions_per_block: RangeInclusive, /// Number of variables that we allocate per function /// This value does not include the signature params pub vars_per_function: RangeInclusive, /// Number of blocks that we generate per function. /// This value does not include the entry block pub blocks_per_function: RangeInclusive, /// Number of params a block should take /// This value does not apply to block0 which takes the function params /// and is thus governed by `signature_params` pub block_signature_params: RangeInclusive, /// Max number of jump tables generated per function /// Note, the actual number of jump tables may be larger if the Switch interface /// decides to insert more. pub jump_tables_per_function: RangeInclusive, pub jump_table_entries: RangeInclusive, /// The Switch API specializes either individual blocks or contiguous ranges. /// In `switch_cases` we decide to produce either a single block or a range. /// The size of the range is controlled by `switch_max_range_size`. pub switch_cases: RangeInclusive, pub switch_max_range_size: RangeInclusive, pub funcrefs_per_function: RangeInclusive, /// Stack slots. /// The combination of these two determines stack usage per function pub static_stack_slots_per_function: RangeInclusive, /// Size in bytes pub static_stack_slot_size: RangeInclusive, } 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, blocks_per_function: 0..=16, block_signature_params: 0..=16, jump_tables_per_function: 0..=4, jump_table_entries: 0..=16, switch_cases: 0..=64, // Ranges smaller than 2 don't make sense. switch_max_range_size: 2..=32, funcrefs_per_function: 0..=8, static_stack_slots_per_function: 0..=8, static_stack_slot_size: 0..=128, } } }