Draft: fix cram tests following change in dune 3.19.0
What
This MR updates the version constraint on Dune to require at least 3.19.0, and it fixes cram tests which were broken by this version of Dune.
Why
Dune 3.19.0 changed how dune exec ./main.exe runs main.exe. Before, it used a relative path. Now, it uses an absolute path. This breaks the cram tests, because Tezt writes the contents of Sys.argv.(0) on its stdout.
How
To discover this regression, I ran ./tezt.sh --file main.ml --test 'Failing test' with Dune 3.18.2 and Dune 3.19.0. This allowed me to observe the difference in behavior.
Instead of trying to make the cram test compatible with multiple versions of Dune, we choose to only support Dune 3.19.0 and later. I tried adding | sed at the end to replace Tezt's output to make it compatible with all versions, but this also changed the exit code, which is not what we want. So I gave up on supporting older versions of Dune.
To fix the cram tests I ran dune runtest --auto-promote and checked the diff.
Manually testing the MR
dune runtest
Or check the CI.
Checklist
-
Update CHANGES.md. No need to document changes to documentation and tests. -
Make sure all new values, types etc. are documented in .mlifiles and that the generated documentation looks ok. -
Add tests in test/, if relevant.