MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / test_trap_backtrace_disabled

Function test_trap_backtrace_disabled

tests/all/traps.rs:213–232  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

211
212#[test]
213fn test_trap_backtrace_disabled() -> Result<()> {
214 let mut config = Config::default();
215 config.wasm_backtrace_max_frames(None);
216 let engine = Engine::new(&config).unwrap();
217 let mut store = Store::<()>::new(&engine, ());
218 let wat = r#"
219 (module $hello_mod
220 (func (export "run") (call $hello))
221 (func $hello (unreachable))
222 )
223 "#;
224
225 let module = Module::new(store.engine(), wat)?;
226 let instance = Instance::new(&mut store, &module, &[])?;
227 let run_func = instance.get_typed_func::<(), ()>(&mut store, "run")?;
228
229 let e = run_func.call(&mut store, ()).unwrap_err();
230 assert!(e.downcast_ref::<WasmBacktrace>().is_none());
231 Ok(())
232}
233
234#[test]
235fn test_trap_trace_cb() -> Result<()> {

Callers

nothing calls this directly

Calls 6

OkFunction · 0.85
newFunction · 0.50
unwrapMethod · 0.45
engineMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected