Struct wasmer_wast::WasiTest
source · pub struct WasiTest<'a> {
wasm_path: &'a str,
args: Vec<&'a str>,
envs: Vec<(&'a str, &'a str)>,
dirs: Vec<&'a str>,
mapped_dirs: Vec<(&'a str, &'a str)>,
temp_dirs: Vec<&'a str>,
assert_return: Option<AssertReturn>,
stdin: Option<Stdin<'a>>,
assert_stdout: Option<AssertStdout<'a>>,
assert_stderr: Option<AssertStderr<'a>>,
}
Expand description
Crate holding metadata parsed from the WASI WAST about the test to be run.
Fields§
§wasm_path: &'a str
§args: Vec<&'a str>
§envs: Vec<(&'a str, &'a str)>
§dirs: Vec<&'a str>
§mapped_dirs: Vec<(&'a str, &'a str)>
§temp_dirs: Vec<&'a str>
§assert_return: Option<AssertReturn>
§stdin: Option<Stdin<'a>>
§assert_stdout: Option<AssertStdout<'a>>
§assert_stderr: Option<AssertStderr<'a>>
Implementations§
source§impl<'a> WasiTest<'a>
impl<'a> WasiTest<'a>
sourcepub fn lex_string(wast: &'a str) -> Result<ParseBuffer<'a>>
pub fn lex_string(wast: &'a str) -> Result<ParseBuffer<'a>>
Turn a WASI WAST string into a list of tokens.
sourcepub fn parse_tokens(tokens: &'a ParseBuffer<'a>) -> Result<Self>
pub fn parse_tokens(tokens: &'a ParseBuffer<'a>) -> Result<Self>
Turn a WASI WAST list of tokens into a WasiTest
struct.
sourcepub fn run(
&self,
store: &mut Store,
base_path: &str,
filesystem_kind: WasiFileSystemKind,
) -> Result<bool>
pub fn run( &self, store: &mut Store, base_path: &str, filesystem_kind: WasiFileSystemKind, ) -> Result<bool>
Execute the WASI test and assert.
sourceasync fn create_wasi_env(
&self,
filesystem_kind: WasiFileSystemKind,
) -> Result<(WasiEnvBuilder, Vec<TempDir>, Pipe, Receiver<Vec<u8>>, Receiver<Vec<u8>>)>
async fn create_wasi_env( &self, filesystem_kind: WasiFileSystemKind, ) -> Result<(WasiEnvBuilder, Vec<TempDir>, Pipe, Receiver<Vec<u8>>, Receiver<Vec<u8>>)>
Create the wasi env with the given metadata.
sourcefn get_version(&self, module: &Module) -> Result<WasiVersion>
fn get_version(&self, module: &Module) -> Result<WasiVersion>
Get the correct [WasiVersion
] from the Wasm [Module
].
sourcefn get_imports(
&self,
store: &mut Store,
ctx: &FunctionEnv<WasiEnv>,
module: &Module,
) -> Result<Imports>
fn get_imports( &self, store: &mut Store, ctx: &FunctionEnv<WasiEnv>, module: &Module, ) -> Result<Imports>
Get the correct WASI import object for the given module and set it up with the
[WasiEnv
].
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for WasiTest<'a>
impl<'a> RefUnwindSafe for WasiTest<'a>
impl<'a> Send for WasiTest<'a>
impl<'a> Sync for WasiTest<'a>
impl<'a> Unpin for WasiTest<'a>
impl<'a> UnwindSafe for WasiTest<'a>
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2where
T: SharedNiching<N1, N2>,
N1: Niching<T>,
N2: Niching<T>,
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2where
T: SharedNiching<N1, N2>,
N1: Niching<T>,
N2: Niching<T>,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Pointee for T
impl<T> Pointee for T
§impl<T> Upcastable for T
impl<T> Upcastable for T
§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref
§fn upcast_any_box(self: Box<T>) -> Box<dyn Any>
fn upcast_any_box(self: Box<T>) -> Box<dyn Any>
upcast boxed dyn