Quantcast
Channel: OCaml - Topics tagged dune
Viewing all articles
Browse latest Browse all 521

Tests in a separate directory with dune; using Base as an example

$
0
0

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:

  1. “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?

  2. 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.

  3. 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

Read full topic


Viewing all articles
Browse latest Browse all 521

Trending Articles