Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

234 config with failure persistence #508

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions proptest/src/test_runner/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,32 @@ impl Config {
result
}

/// Constructs a `Config` only differing from the `default()` in the
/// failure_persistence member.
///
/// This is simply a more concise alternative to using field-record update
/// syntax:
///
/// ```
/// # use proptest::test_runner::{Config, FileFailurePersistence};
/// assert_eq!(
/// Config::with_failure_persistence(FileFailurePersistence::WithSource("regressions")),
/// Config {
/// failure_persistence: Some(Box::new(FileFailurePersistence::WithSource("regressions"))),
/// .. Config::default()
/// }
/// );
/// ```
pub fn with_failure_persistence<T>(failure_persistence: T) -> Self
where
T: FailurePersistence + 'static,
{
Self {
failure_persistence: Some(Box::new(failure_persistence)),
..Default::default()
}
}

/// Return whether this configuration implies forking.
///
/// This method exists even if the "fork" feature is disabled, in which
Expand Down
Loading