Skip to main content

Module component_api

Module component_api 

Source
Expand description

This module generates test cases for the Wasmtime component model function APIs, e.g. wasmtime::component::func::Func and TypedFunc.

Each case includes a list of arbitrary interface types to use as parameters, plus another one to use as a result, and a component which exports a function and imports a function. The exported function forwards its parameters to the imported one and forwards the result back to the caller. This serves to exercise Wasmtime’s lifting and lowering code and verify the values remain intact during both processes.

Functions§

dynamic_component_api_target
Generate and execute a crate::generators::component_types::TestCase using the specified input to create arbitrary types and values.
static_api_test
Generate zero or more sets of arbitrary argument and result values and execute the test using those values, asserting that they flow from host-to-guest and guest-to-host unchanged.