[−][src]Struct libtest_mimic::Arguments
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.
The CLI is very similar to the one from the native test harness. However, there are minor differences:
- Most notable: the
--helpmessage is slightly different. This comes from the fact that this crate (right now) uses structopt (which usesclap) while the originallibtestusesdocopt. --skiponly accepts one value per occurence (but can occur multiple times). This solves ambiguity with thefiltervalue at the very end. Consider "--skip foo bar": should this be parsed asskip: vec!["foo", "bar"], filter: Noneorskip: vec!["foo"], filter: Some("bar")? Here, it's clearly the latter version. If you need multiple values forskip, do it like this:--skip foo --skip bar.--benchand--testcannot be both set at the same time. It doesn't make sense, but it's allowed inlibtestfor some reason.
Note: just because all CLI args can be parsed, doesn't mean that they
are all automatically used. Check run_tests for information on which
arguments are automatically used and require special care.
Fields
ignored: boolDetermines if ignored tests should be run.
test: boolRun tests, but not benchmarks.
bench: boolRun benchmarks, but not tests.
list: boolOnly list all tests and benchmarks.
nocapture: boolIf set, stdout/stderr are not captured during the test but are instead printed directly.
exact: boolIf set, filters are matched exactly rather than by substring.
quiet: boolIf set, display only one character per test instead of one line. Especially useful for huge test suites.
This is an alias for --format=terse. If this is set, format is
None.
num_threads: Option<u32>Number of threads used for parallel testing.
logfile: Option<String>Path of the logfile. If specified, everything will be written into the file instead of stdout.
skip: Vec<String>A list of filters. Tests whose names contain parts of any of these filters are skipped.
color: Option<ColorSetting>Specifies whether or not to color the output.
format: Option<FormatSetting>Specifies the format of the output.
filter_string: Option<String>Filter string. Only tests which contain this string are run.
Methods
impl Arguments[src]
pub fn from_args() -> Self[src]
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.
Trait Implementations
impl Clone for Arguments[src]
impl Debug for Arguments[src]
impl StructOpt for Arguments[src]
fn clap<'a, 'b>() -> App<'a, 'b>[src]
fn from_clap(matches: &ArgMatches) -> Self[src]
fn from_args() -> Self[src]
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone, [src]
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
fn from_iter_safe<I>(iter: I) -> Result<Self, Error> where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone, [src]
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
Auto Trait Implementations
impl Send for Arguments
impl Sync for Arguments
impl Unpin for Arguments
impl RefUnwindSafe for Arguments
impl UnwindSafe for Arguments
Blanket Implementations
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,