missing usage with dune
listing qcheck within my dune file's libraries didn't work, I ended up realizing that I need to instead list qcheck-core. I suggest adding this to the README. Also, do I need to opam install qcheck if I'm not importing it and just importing qcheck-core?
If you're just using qcheck-core, then opam install qcheck-core is
enough. qcheck is a compatibility package that installs the core and
some other things, it's not necessary otherwise.
First off: yes, the documentation could certainly be improved (PRs welcome!)
I cannot recreate the problem you experienced. Below follows my attempt at a minimal repro which works fine.
As @c-cube mentions, this is using the qcheck compatibility package, so it needs to be adapted to use qcheck-core instead.
dune-project:
(lang dune 3.0)
dune:
(test
(name test)
(modules test)
(libraries qcheck)
)
test.ml:
open QCheck
let t = Test.make ~name:"float test" float (fun f -> floor f <= f)
let _ = QCheck_runner.run_tests ~verbose:true [t]
I guess that setting (implicit_transitive_deps false) in the dune-project file might be what triggers the bug and make it require qcheck-core ?
Indeed! I can confirm that after adding that line to dune-project I get the following error message:
$ dune build test.exe
File "test.ml", line 1, characters 5-11:
1 | open QCheck
^^^^^^
Error: Unbound module QCheck
This is confusing to a new-comer and documentation could help here, e.g., by pointing them to use qcheck-core instead.
yes we use implicit_transitive_deps false (which really should be default for all projects :D)