Dune query, public library, non-public test files, public test executables

Dear All,

I have a base library, which I give a public name to. The .ml files live in root/src/

Additionally, I have various .ml files to support testing. These depend on the stuff in the base library. These files are in root/test/. I don’t want them in the base library (they aren’t part of the library proper).

Additionally, I have a test executable, which depends on the base library, and the testing .ml files. This lives in root/bin/

My question is: how to tell dune about this? I don’t want a public library for the testing .ml files. Also, I want a .merlin in the root/bin directory which references the compiled versions of the base lib and the stuff in root/test.

Just to say: at the moment I have a test/dune which looks like this:

(library
  (name tjr_pcache_test)
  (libraries tjr_pcache)
)

ie a non-public test lib.

And a bin/dune which looks like this:

(executables
  (names run_tests)
  (libraries tjr_pcache tjr_pcache_test ))

ie the executable depends on the public tjr_pcache and the non-public tjr_pcache_test.

This is almost perfect. Except that there is no generated .merlin file in the test/ directory or the bin/ directory

There should be a .merlin wherever you have a test(s) or executable(s) stanza. So if you’ve defined your tests in those dirs, the .merlin should be generated. Otherwise this is a bug.

Please ignore this question. I think I am not getting a .merlin because I am not building the bin/ executable. If I try to build it, the .merlin appears.

Apologies for the noise.