Skip to content

Run tests/tests.exe from dune - #433

Open
shonfeder wants to merge 1 commit into
LPCIC:masterfrom
shonfeder:run-tests-thru-dune
Open

Run tests/tests.exe from dune#433
shonfeder wants to merge 1 commit into
LPCIC:masterfrom
shonfeder:run-tests-thru-dune

Conversation

@shonfeder

@shonfeder shonfeder commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

By running tests/tests.exe with dune exec we can ensure that any other executables dune is aware of will be available for the tests/test.exe. It will also ensure that the tests/test.exe is up to date before being run.

This suggestion is motivated by a test failures encountered in my dev env while working on #432, due to the inability to locate the ydump executable (provided by yocaml), which is an implicit dependency assumed by tests/suite/suite.ml:

let outcomey = Some (Util.exec ~timeout ~timetool ~input:(snd output_file_tmp) ~executable:"ydump" ~env ~log:output_file ~args:[] ()) in

Development environments using the right opam switch will have ydump available in the environment, but other environments may not (E.g., i'm using dune package management). If these tests were being run inside dune, we'd specify ydump as a dependency to be made available on the path via %{bin:ydumb}, but that's obviously not available from the Makefile.

By running tests/tests.exe we can ensure that any other executables dune
is aware of will be available for the tests/test.exe. It will also
ensure that the `tests/test.exe` is up to date before being run.

This suggestion is motivated by test failures on my machine, due to the
inability to locate `ydump` executable, which is an implicit dependency
assumed by tests/suite/suite.ml. Development environments using the
right opam switch will have `ydump` available in the environment, but
other environments may not (I'm using dune package management). If these
tests were being run inside dune, we'd specify `ydump` as a dependency
to be made available on the path via `%{bin:ydumb}`.
@gares

gares commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Looks good, but are env variable preserved by dune exec?

@gares

gares commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Just to be sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants