Struct forc::cli::TestCommand
source · Expand description
Run the Sway unit tests for the current project.
NOTE: Previously this command was used to support Rust integration testing, however the
provided behaviour served no benefit over running cargo test directly. The proposal to change
the behaviour to support unit testing can be found at the following link:
https://github.com/FuelLabs/sway/issues/1833
Sway unit tests are functions decorated with the #[test] attribute. Each test is compiled as
a unique entry point for a single program and has access to the namespace of the module in
which it is declared.
Unit tests decorated with the #[test(script)] attribute that are declared within contract
projects may also call directly into their associated contract’s ABI.
Upon successful compilation, test scripts are executed to their completion. A test is
considered a failure in the case that a revert (rvrt) instruction is encountered during
execution. Otherwise, it is considered a success.
Fields§
§build: Build§filter: Option<String>When specified, only tests containing the given string will be executed.
Trait Implementations§
source§impl CommandFactory for Command
impl CommandFactory for Command
source§fn into_app_for_update<'b>() -> Command<'b>
fn into_app_for_update<'b>() -> Command<'b>
CommandFactory::command_for_updatesource§impl FromArgMatches for Command
impl FromArgMatches for Command
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.