fix: Allow PROPTEST_CASES to override the lower block case default
@@ -15,6 +15,7 @@ use proptest::{
prelude::*,
test_runner::Config,
};
+use std::env;
use std::io::{Cursor, ErrorKind, Write};
impl Arbitrary for BlockHeader {
@@ -214,8 +215,12 @@ proptest! {
}
proptest! {
- // The block roundtrip test can be really slow
- #![proptest_config(Config::with_cases(16))]
+ // The block roundtrip test can be really slow, so we use fewer cases by
+ // default. Set the PROPTEST_CASES env var to override this default.
+ #![proptest_config(Config::with_cases(env::var("PROPTEST_CASES")
+ .ok()
+ .and_then(|v| v.parse().ok())
+ .unwrap_or(16)))]
#[test]
fn block_roundtrip(block in any::<Block>()) {
