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

Function instantiate_async

tests/all/call_hook.rs:328–344  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

326
327#[tokio::test]
328async fn instantiate_async() -> Result<(), Error> {
329 let engine = Engine::default();
330 let mut store = Store::new(&engine, State::default());
331 store.call_hook(sync_call_hook);
332
333 let m = Module::new(store.engine(), "(module)")?;
334 Instance::new_async(&mut store, &m, &[]).await?;
335 assert_eq!(store.data().calls_into_wasm, 0);
336 assert_eq!(store.data().calls_into_host, 0);
337
338 let m = Module::new(store.engine(), "(module (func) (start 0))")?;
339 Instance::new_async(&mut store, &m, &[]).await?;
340 assert_eq!(store.data().calls_into_wasm, 1);
341 assert_eq!(store.data().calls_into_host, 0);
342
343 Ok(())
344}
345
346#[test]
347fn recursion() -> Result<(), Error> {

Callers 15

runFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
run_wasiFunction · 0.85
run_testFunction · 0.85
run_testFunction · 0.85
run_wasiFunction · 0.85
instantiateFunction · 0.85
p2_api_reactorFunction · 0.85
runFunction · 0.85
run_with_builderFunction · 0.85
test_yield_post_returnFunction · 0.85

Calls 4

OkFunction · 0.85
newFunction · 0.50
call_hookMethod · 0.45
engineMethod · 0.45

Tested by 15

runFunction · 0.68
run_wasiFunction · 0.68
run_testFunction · 0.68
run_testFunction · 0.68
run_wasiFunction · 0.68
instantiateFunction · 0.68
p2_api_reactorFunction · 0.68
runFunction · 0.68
run_with_builderFunction · 0.68
test_yield_post_returnFunction · 0.68
test_round_trip_directFunction · 0.68
test_async_short_readsFunction · 0.68