pub struct Opts { /* private fields */ }Expand description
Tool to run tests that exercise the wit-bindgen bindings generator.
This tool is used to (a) generate bindings for a target language, (b) compile the bindings and source code to a wasm component, (c) compose a “runner” and a “test” component together, and (d) execute this component to ensure that it passes. This process is guided by filesystem structure which must adhere to some conventions.
-
Tests are located in any directory that contains a
test.witdescription of the WIT being tested. The<TEST>argument to this command is walked recursively to findtest.witfiles. -
The
test.witfile must have arunnerworld and atestworld. The “runner” should import interfaces that are exported by “test”. -
Adjacent to
test.witshould be a number ofrunner*.*files. There is one runner per source language, for examplerunner.rsandrunner.c. These are source files for therunnerworld. Source files can start with//@ ...comments to deserialize intoconfig::RuntimeTestConfig, currently that supports://@ args = ['--arguments', 'to', '--the', 'bindings', '--generator']or
//@ args = '--arguments to --the bindings --generator' -
Adjacent to
test.witshould also be a number oftest*.*files. Like runners there is one per source language. Note that you can have multiple implementations of tests in the same language too, for exampletest-foo.rsandtest-bar.rs. All tests must export the sametestworld fromtest.wit, however.
This tool will discover test.wit files, discover runners/tests, and then
compile everything and run the combinatorial matrix of runners against
tests. It’s expected that each runner.* and test.* perform the same
functionality and only differ in source language.
Implementations§
Trait Implementations§
Source§impl Args for Opts
impl Args for Opts
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl CommandFactory for Opts
impl CommandFactory for Opts
Source§impl FromArgMatches for Opts
impl FromArgMatches for Opts
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Parser for Opts
impl Parser for Opts
Source§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
Source§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
Source§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
Auto Trait Implementations§
impl Freeze for Opts
impl RefUnwindSafe for Opts
impl Send for Opts
impl Sync for Opts
impl Unpin for Opts
impl UnwindSafe for Opts
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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