Struct libtest_mimic::Arguments[][src]

pub struct Arguments {
    pub ignored: bool,
    pub test: bool,
    pub bench: bool,
    pub list: bool,
    pub nocapture: bool,
    pub exact: bool,
    pub quiet: bool,
    pub num_threads: Option<u32>,
    pub logfile: Option<String>,
    pub skip: Vec<String>,
    pub color: Option<ColorSetting>,
    pub format: Option<FormatSetting>,
    pub filter_string: Option<String>,
}

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 --help message is slightly different. This comes from the fact that this crate (right now) uses structopt (which uses clap) while the original libtest uses docopt.
  • --skip only accepts one value per occurence (but can occur multiple times). This solves ambiguity with the filter value at the very end. Consider "--skip foo bar": should this be parsed as skip: vec!["foo", "bar"], filter: None or skip: vec!["foo"], filter: Some("bar")? Here, it's clearly the latter version. If you need multiple values for skip, do it like this: --skip foo --skip bar.
  • --bench and --test cannot be both set at the same time. It doesn't make sense, but it's allowed in libtest for 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

Determines if ignored tests should be run.

Run tests, but not benchmarks.

Run benchmarks, but not tests.

Only list all tests and benchmarks.

If set, stdout/stderr are not captured during the test but are instead printed directly.

If set, filters are matched exactly rather than by substring.

If 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.

Number of threads used for parallel testing.

Path of the logfile. If specified, everything will be written into the file instead of stdout.

A list of filters. Tests whose names contain parts of any of these filters are skipped.

Specifies whether or not to color the output.

Specifies the format of the output.

Filter string. Only tests which contain this string are run.

Methods

impl Arguments
[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 StructOpt for Arguments
[src]

Returns the corresponding clap::App.

Creates the struct from clap::ArgMatches. It cannot fail with a parameter generated by clap by construction. Read more

Gets the struct from the command line arguments. Print the error message and quit the program in case of failure. Read more

Gets the struct from any iterator such as a Vec of your making. Print the error message and quit the program in case of failure. Read more

Gets the struct from any iterator such as a Vec of your making. Read more

impl Debug for Arguments
[src]

Formats the value using the given formatter. Read more

impl Clone for Arguments
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for Arguments

impl Sync for Arguments