pub struct Arguments {Show 24 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 show_stats: bool,
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: bool
Run ignored and not ignored tests
ignored: bool
Run only ignored tests
exclude_should_panic: bool
Excludes tests marked as should_panic
test: bool
Run tests and not benchmarks
bench: bool
Run benchmarks instead of tests
list: bool
List all tests and benchmarks
logfile: Option<String>
Write logs to the specified file
nocapture: bool
don’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: bool
Display one character per test instead of one line.
Alias to --format=terse
exact: bool
Exactly match filters rather than by substring
color: Option<ColorSetting>
Configure coloring of output
format: Option<FormatSetting>
Configure formatting of output
show_output: bool
Show captured stdout of successful tests
unstable_flags: Option<UnstableFlags>
Enable nightly-only flags
report_time: bool
Show 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: bool
Treat 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: bool
Run tests in random order
shuffle_seed: Option<u64>
Run tests in random order; seed the random number generator with SEED
show_stats: bool
Show detailed benchmark statistics for each benchmark
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: bool
If true, spawn worker processes in IPC mode and run the tests on those
Implementations§
Source§impl Arguments
impl Arguments
Sourcepub fn from_args() -> Self
pub fn from_args() -> Self
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<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
.