Files
wasmtime/crates/fuzzing/tests/regressions.rs
2020-02-04 18:47:20 -06:00

30 lines
1009 B
Rust

//! Regression tests for bugs found via fuzzing.
//!
//! The `#[test]` goes in here, the Wasm binary goes in
//! `./regressions/some-descriptive-name.wasm`, and then the `#[test]` should
//! use the Wasm binary by including it via
//! `include_bytes!("./regressions/some-descriptive-name.wasm")`.
use wasmtime::{Config, Strategy};
use wasmtime_fuzzing::oracles;
#[test]
fn instantiate_empty_module() {
let data = wat::parse_str(include_str!("./regressions/empty.wat")).unwrap();
oracles::instantiate(&data, Strategy::Auto);
}
#[test]
fn instantiate_empty_module_with_memory() {
let data = wat::parse_str(include_str!("./regressions/empty_with_memory.wat")).unwrap();
oracles::instantiate(&data, Strategy::Auto);
}
#[test]
fn instantiate_module_that_compiled_to_x64_has_register_32() {
let mut config = Config::new();
config.debug_info(true);
let data = wat::parse_str(include_str!("./regressions/issue694.wat")).unwrap();
oracles::instantiate_with_config(&data, config);
}