diff options
Diffstat (limited to 'vendor/proptest/src/test_runner/config.rs')
-rw-r--r-- | vendor/proptest/src/test_runner/config.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/vendor/proptest/src/test_runner/config.rs b/vendor/proptest/src/test_runner/config.rs index a3d30846a..04940abc4 100644 --- a/vendor/proptest/src/test_runner/config.rs +++ b/vendor/proptest/src/test_runner/config.rs @@ -49,8 +49,10 @@ const RNG_ALGORITHM: &str = "PROPTEST_RNG_ALGORITHM"; const DISABLE_FAILURE_PERSISTENCE: &str = "PROPTEST_DISABLE_FAILURE_PERSISTENCE"; +/// Override the config fields from environment variables, if any are set. +/// Without the `std` feature this function returns config unchanged. #[cfg(feature = "std")] -fn contextualize_config(mut result: Config) -> Config { +pub fn contextualize_config(mut result: Config) -> Config { fn parse_or_warn<T: FromStr + fmt::Display>( src: &OsString, dst: &mut T, @@ -141,8 +143,9 @@ fn contextualize_config(mut result: Config) -> Config { result } +/// Without the `std` feature this function returns config unchanged. #[cfg(not(feature = "std"))] -fn contextualize_config(result: Config) -> Config { +pub fn contextualize_config(result: Config) -> Config { result } @@ -271,6 +274,7 @@ pub struct Config { /// only considered when the `std` feature is enabled, which it is by /// default.) #[cfg(feature = "fork")] + #[cfg_attr(docsrs, doc(cfg(feature = "fork")))] pub fork: bool, /// If non-zero, tests are run in a subprocess and each generated case @@ -292,6 +296,7 @@ pub struct Config { /// only considered when the `std` feature is enabled, which it is by /// default.) #[cfg(feature = "timeout")] + #[cfg_attr(docsrs, doc(cfg(feature = "timeout")))] pub timeout: u32, /// If non-zero, give up the shrinking process after this many milliseconds @@ -307,6 +312,7 @@ pub struct Config { /// only considered when the `std` feature is enabled, which it is by /// default.) #[cfg(feature = "std")] + #[cfg_attr(docsrs, doc(cfg(feature = "std")))] pub max_shrink_time: u32, /// Give up on shrinking if more than this number of iterations of the test @@ -360,6 +366,7 @@ pub struct Config { /// `PROPTEST_VERBOSE` environment variable. (The variable is only considered /// when the `std` feature is enabled, which it is by default.) #[cfg(feature = "std")] + #[cfg_attr(docsrs, doc(cfg(feature = "std")))] pub verbose: u32, /// The RNG algorithm to use when not using a user-provided RNG. |