On Mon, Sep 29, 2014 at 9:28 AM, ygrek <ygrek@autistici.org> wrote:
One can also reverse that - write the tests in the .ml file and register
in the global mutable list of tests, then iterate over that list during test run.
One downside is that it relies on all modules being linked in.

That's what pa_ounit [1] is doing. It allows you to write this in the source code:

TEST name? = <boolean expr> (* true means ok, false or exn means broken *)
TEST_UNIT name? = <unit expr> (* () means ok, exn means broken *)
TEST_MODULE name? = <module expr> (* to group TESTs (to share some setup for instance) *)

And have the tests run if you pass specific command line arugments.

  [1] https://github.com/janestreet/pa_ounit

--
Jeremie