Struct forc::cli::TestCommand
source · Expand description
Run the Sway unit tests for the current project.
NOTE: This feature is not yet implemented. Track progress at the following link: https://github.com/FuelLabs/sway/issues/1832
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: Buildunstable: boolEnable the incomplete, unstable unit testing support. Warning: May create a black hole!
This is purely for Sway devs to test the unit testing functionality until it stabilises, and will be removed upon stabilisation of the command.
filter: Option<String>When specified, only tests containing the given string will be executed.
Trait Implementations
sourceimpl CommandFactory for Command
impl CommandFactory for Command
sourcefn into_app_for_update<'b>() -> Command<'b>
fn into_app_for_update<'b>() -> Command<'b>
CommandFactory::command_for_updatesourcefn command_for_update<'help>() -> App<'help>
fn command_for_update<'help>() -> App<'help>
sourceimpl FromArgMatches for Command
impl FromArgMatches for Command
sourcefn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
sourcefn 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>
sourcefn 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.sourcefn 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.