Hi everyone,
I’m new to OCaml and trying to get oriented with dune so that I can build projects and run tests automatically. Using python as an example, I would usually write tests within separate files under a “project_root/test” directory and run them with “pytest”. I’m trying to do the same thing using dune, and I’m looking at Jane Street’s Base library as an example.
A few questions:
-
“dune runtest” doesn’t seem to run the Base tests. I’ve emulated the structure used in Base within my own project and added some tests that will fail - but nothing happens with “dune runtest”. How can I actually run these tests?
-
Is this a good approach in general, or should I be writing inline tests directly within the module’s ml files? For longer test suites I’d imagine separate files are preferred.
-
Is there a good up-to-date resource on best practices for testing? I read the dune documentation but the discussion there isn’t very detailed when it comes to testing.
Thanks!
2 posts - 1 participant