Struct proptest::prelude::ProptestConfig [] [src]

pub struct ProptestConfig {
    pub cases: u32,
    pub max_local_rejects: u32,
    pub max_global_rejects: u32,
    pub max_flat_map_regens: u32,
    pub failure_persistence: Option<Box<FailurePersistence>>,
    pub source_file: Option<&'static str>,
    // some fields omitted
}

Configuration for how a proptest test should be run.

Fields

The number of successful test cases that must execute for the test as a whole to pass.

This does not include implicitly-replayed persisted failing cases.

The default is 256, which can be overridden by setting the PROPTEST_CASES environment variable.

The maximum number of individual inputs that may be rejected before the test as a whole aborts.

The default is 65536, which can be overridden by setting the PROPTEST_MAX_LOCAL_REJECTS environment variable.

The maximum number of combined inputs that may be rejected before the test as a whole aborts.

The default is 1024, which can be overridden by setting the PROPTEST_MAX_GLOBAL_REJECTS environment variable.

The maximum number of times all Flatten combinators will attempt to regenerate values. This puts a limit on the worst-case exponential explosion that can happen with nested Flattens.

The default is 1_000_000, which can be overridden by setting the PROPTEST_MAX_FLAT_MAP_REGENS environment variable.

Indicates whether and how to persist failed test results.

When compiling with "std" feature (i.e. the standard library is available), the default is Some(Box::new(FileFailurePersistence::SourceParallel("proptest-regressions"))).

Without the standard library, the default is None, and no persistence occurs.

See the docs of FileFailurePersistence and MapFailurePersistence for more information.

The default cannot currently be overridden by an environment variable.

File location of the current test, relevant for persistence and debugging.

Note the use of &str rather than Path to be compatible with #![no_std] use cases wherePath` is unavailable.

See the docs of FileFailurePersistence for more information on how it may be used for persistence.

Methods

impl Config
[src]

[src]

Constructs a Config only differing from the default() in the number of test cases required to pass the test successfully.

This is simply a more concise alternative to using field-record update syntax:

assert_eq!(
    Config::with_cases(42),
    Config { cases: 42, .. Config::default() }
);

[src]

Constructs a Config only differing from the default() in the source_file of the present test.

This is simply a more concise alternative to using field-record update syntax:

assert_eq!(
    Config::with_source_file("computer/question"),
    Config { source_file: Some("computer/question"), .. Config::default() }
);

[src]

Constructs a Config only differing from the provided Config instance, self, in the source_file of the present test.

This is simply a more concise alternative to using field-record update syntax:

let a = Config::with_source_file("computer/question");
let b = a.clone_with_source_file("answer/42");
assert_eq!(
    a,
    Config { source_file: Some("computer/question"), .. Config::default() }
);
assert_eq!(
    b,
    Config { source_file: Some("answer/42"), .. Config::default() }
);

Trait Implementations

impl Clone for Config
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Config
[src]

[src]

Formats the value using the given formatter. Read more

impl PartialEq for Config
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Default for Config
[src]

[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations

impl Send for Config

impl Sync for Config