fix: Allow PROPTEST_CASES to override the lower block case default

This commit is contained in:
teor 2020-08-05 18:12:34 +10:00 committed by Henry de Valence
parent 82da4a5326
commit d49c11ee70
1 changed files with 7 additions and 2 deletions

View File

@ -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>()) {