pub struct Arguments {Show 23 fields
pub include_ignored: bool,
pub ignored: bool,
pub exclude_should_panic: bool,
pub test: bool,
pub bench: bool,
pub list: bool,
pub logfile: Option<String>,
pub nocapture: bool,
pub test_threads: Option<usize>,
pub skip: Vec<String>,
pub quiet: bool,
pub exact: bool,
pub color: Option<ColorSetting>,
pub format: Option<FormatSetting>,
pub show_output: bool,
pub unstable_flags: Option<UnstableFlags>,
pub report_time: bool,
pub ensure_time: bool,
pub shuffle: bool,
pub shuffle_seed: Option<u64>,
pub filter: Option<String>,
pub ipc: Option<String>,
pub spawn_workers: bool,
}Expand description
Command line arguments.
This type represents everything the user can specify via CLI args. The main
method is from_args which reads the global
std::env::args() and parses them into this type.
Fields§
§include_ignored: boolRun ignored and not ignored tests
ignored: boolRun only ignored tests
exclude_should_panic: boolExcludes tests marked as should_panic
test: boolRun tests and not benchmarks
bench: boolRun benchmarks instead of tests
list: boolList all tests and benchmarks
logfile: Option<String>Write logs to the specified file
nocapture: booldon’t capture stdout/stderr of each task, allow printing directly
test_threads: Option<usize>Number of threads used for running tests in parallel
skip: Vec<String>Skip tests whose names contains FILTER (this flag can be used multiple times)
quiet: boolDisplay one character per test instead of one line.
Alias to --format=terse
exact: boolExactly match filters rather than by substring
color: Option<ColorSetting>Configure coloring of output
format: Option<FormatSetting>Configure formatting of output
show_output: boolShow captured stdout of successful tests
unstable_flags: Option<UnstableFlags>Enable nightly-only flags
report_time: boolShow execution time of each test.
Threshold values for colorized output can be configured via RUST_TEST_TIME_UNIT,
RUST_TEST_TIME_INTEGRATION and RUST_TEST_TIME_DOCTEST environment variables.
Expected format of the environment variables is VARIABLE=WARN_TIME,CRITICAL_TIME.
Durations must be specified in milliseconds, e.g. 500,2000 means that the warn time is 0.5
seconds, and the critical time is 2 seconds.
Not available for --format=terse.
ensure_time: boolTreat excess of the test execution time limit as error.
Threshold values for this option can be configured via RUST_TEST_TIME_UNIT,
RUST_TEST_TIME_INTEGRATION and RUST_TEST_TIME_DOCTEST environment variables.
Expected format of the environment variables is VARIABLE=WARN_TIME,CRITICAL_TIME.
CRITICAL_TIME here means the limit that should not be exceeded by test.
shuffle: boolRun tests in random order
shuffle_seed: Option<u64>Run tests in random order; seed the random number generator with SEED
filter: Option<String>The FILTER string is tested against the name of all tests, and only those tests whose names contain the filter are run. Multiple filter strings may be passed, which will run all tests matching any of the filters.
ipc: Option<String>Run the test suite in worker IPC mode - listening on the given local socket waiting for the test runner to connect and send test execution requests. The only stdout/stderr output will be the one emitted by the actual test runs so the test runner can capture them.
spawn_workers: boolIf true, spawn worker processes in IPC mode and run the tests on those
Implementations§
source§impl Arguments
impl Arguments
sourcepub fn from_args() -> Arguments
pub fn from_args() -> Arguments
Parses the global CLI arguments given to the application.
If the parsing fails (due to incorrect CLI args), an error is shown and
the application exits. If help is requested (-h or --help), a help
message is shown and the application exits, too.
sourcepub fn to_args(&self) -> Vec<OsString>
pub fn to_args(&self) -> Vec<OsString>
Renders the arguments as a list of strings that can be passed to a subprocess
pub fn unit_test_threshold(&self) -> TimeThreshold
pub fn integration_test_threshold(&self) -> TimeThreshold
Trait Implementations§
source§impl Args for Arguments
impl Args for Arguments
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 Arguments
impl CommandFactory for Arguments
source§impl FromArgMatches for Arguments
impl FromArgMatches for Arguments
source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Arguments, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Arguments, Error>
source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Arguments, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Arguments, 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<A> FromIterator<A> for Arguments
impl<A> FromIterator<A> for Arguments
source§impl Parser for Arguments
impl Parser for Arguments
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 Arguments
impl RefUnwindSafe for Arguments
impl Send for Arguments
impl Sync for Arguments
impl Unpin for Arguments
impl UnwindSafe for Arguments
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)