This change allows generators in a QuickCheck instance to be seeded via the environment. The main motivation is faithfully reproducing tests, i.e. with the same seeds. One common use-case would be automated bisects.
For example, a CI system could provide a seed which is stored alongside the report. In the case of failure, that seed could then be used for bisecting, eliminating the chance of falsely flagging a "bad" commit as "good" due to the randomness of input values.
This change is based on #278 (for Gen::from_seed).
What's still missing:
[x] Documentation: I found the section of the README mentioning the other environment variables not a suitable place.
[ ] Decide whether or not it's a problem to use the same seed for all tests. I don't think so, since the same seeded Gen will be used for all runs of a given test, and thus we'll produce different input values for each iteration. But maybe I overlooked something?
This change allows generators in a
QuickCheck
instance to be seeded via the environment. The main motivation is faithfully reproducing tests, i.e. with the same seeds. One common use-case would be automated bisects.For example, a CI system could provide a seed which is stored alongside the report. In the case of failure, that seed could then be used for bisecting, eliminating the chance of falsely flagging a "bad" commit as "good" due to the randomness of input values.
This change is based on #278 (for
Gen::from_seed
).What's still missing:
Gen
will be used for all runs of a given test, and thus we'll produce different input values for each iteration. But maybe I overlooked something?