Agh, as soon as I post I see that the run-one-directory thing is a dune feature, but I think dune knows very little about alcotest (it’s just a “custom test”).
So I guess I need to use alcotest more directly to do this…
Edit: I see I can run just the tests for my project (rather than its dependencies) using:
dune runtest -f -p proj
(where proj
is the name of the dune project as defined in file dune-project
in the name
s-expression)
I’d still like to know how to run just a subset of alcotest tests – for example, a single test file or a single test. Tantalisingly there is this: How can you build the test executable in dune without running the executable - #7 by JohnWu – but the gist is gone
Edit again: What I was looking for turns out to be this:
dune exec test/run_tests.exe -- --help