c-cube / qcheck

QuickCheck inspired property-based testing for OCaml.
https://c-cube.github.io/qcheck/
BSD 2-Clause "Simplified" License
345 stars 37 forks source link

Run expect tests on OCaml5 #262

Closed jmid closed 1 year ago

jmid commented 1 year ago

This PR fixes #252 to prepare for the forthcoming OCaml5 release.

Since OCaml5 comes with a new, splittable LXM PRNG (https://github.com/ocaml/ocaml/pull/10742), the output distribution from Random.State.* changes - and so affects our QCheck expect tests. This PR adds .ocaml5 output-files similar to the current .32 and .64 files for OCaml<5.0 on 32-bit and 64-bit, respectively. The meta-programming in dune-files is then extended to account for the .ocaml5-case. OCaml5 will not support 32-bit in the foreseeable future (if ever) which eliminates a case.

There are two nits with the approach:

Another solution to the above would be to use https://github.com/ocaml/randomV - a backward port of OCaml5's LXM PRNG.

Overall I therefore believe this PR is a reasonable first step to get expect tests running on OCaml5.

I've tested the PR code locally on

While doing the latter I spotted the missing 32-bit update fixed in #261