Passing command-line arguments to inline tests

I have a test function for a particular module for which the stimulus is read from a file. I have a file variable which is a string of the path to the file. To run the tests, I have to specify the input files in the “deps” argument in dune to have it included in the sandbox while running the test. I want to be able to pass this file as a command line argument to dune, without having to modify the deps each time. Is there a way to do this?

My build command is:
dune build @runtest-<alias>

I want (equivalent)
dune build @runtest-<alias> -- --file=</path/to/file> --arg2=val2 ...

And dune:

(library
 (name test_top)
 (modules test_top)
 (libraries
  <lib1>
  <lib2>
  <test_target>)
 (preprocess
  (pps <pps1> <pps2>))
 (inline_tests
  (deps input.txt input2.txt input_ex.txt)))
1 Like