I have a project where I want to change the failure_persistence configuration, but it does not seem to be taking effect. When I run the following test, it still shows the failed to find lib.rs or main.rs warning
running 1 test
proptest: FileFailurePersistence::SourceParallel set, but failed to find lib.rs or main.rs
29
24
14
test test::test ... ok
despite the failure_persistence being set to FileFailurePersistence::Direct. The cases property in the same configuration is being picked up.
src/test.rs:
fn main() {
println!("Hello, world!");
}
#[cfg(test)]
mod test {
use proptest::test_runner::FileFailurePersistence;
proptest::proptest! {
#![proptest_config(proptest::test_runner::Config {
failure_persistence: Some(Box::new(FileFailurePersistence::Direct("failure_persistence.txt"))),
cases: 3,
..Default::default()
})]
#[test]
fn test(a in 0..30) {
println!("{a}")
}
}
}
Cargo.toml:
[package]
name = "proptest-file"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[[bin]]
name = "test"
path = "src/test.rs"
[dependencies]
proptest = "1.4.0"
I have a project where I want to change the
failure_persistence
configuration, but it does not seem to be taking effect. When I run the following test, it still shows thefailed to find lib.rs or main.rs
warningdespite the
failure_persistence
being set toFileFailurePersistence::Direct
. Thecases
property in the same configuration is being picked up.src/test.rs
:Cargo.toml
: