Skip to content

Conversation

@NathanReb
Copy link
Contributor

This migrates the test suite from using a custom script to using dune's cram test, effectively re-enabling the test suite in opam.

This makes our test a bit more standard and easier to understand for new contributors. It also keeps all of a test relevant information in a single file: the data, the parameters, the commands being run, it's all in one place and very straightforward to read and understand and use the standard dune promotion workflow.

I took extra care in porting the failing tests as we used to generate an html report to highlight the diffs. In those I run ocp-indent and compare the output with the expected formatting to highlight the specific bits we know we don't handle as intended. I also added a README describing this in the tests/failing/ folder.

A good follow up to this would be to split some of the tests into smaller bits so that the input and output leave closer together in the cram files. A lot of the test were written in large files with multiple test cases. We could keep the same file structure but test each individual case one after the other. For now I sticked to the same granularity, ocp-indent is called on the exact same files as before.

@NathanReb
Copy link
Contributor Author

I wanted to port the tests before merging #323 and #324 to make sure everything was working as expected there.

I realize there's no running CI for this repo either so that's a good thing to add as well.

Nathan Rebours added 2 commits September 22, 2025 14:36
Signed-off-by: Nathan Rebours <[email protected]>
@NathanReb NathanReb merged commit 0c32a17 into OCamlPro:master Sep 22, 2025
7 checks passed
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.

1 participant