Skip to content

Conversation

@WardBrian
Copy link
Contributor

Requested by @Julow here.

This fixes up the letop-punning tests to avoid duplicating the same .ml file (and adds a test/failing case that I will resolve in a separate PR), and adds a section to CONTRIBUTING.md that should help others in the future get onboarded with the testing system.

CONTRIBUTING.md Outdated
The remainder of the tests are so called "golden" or "expect" tests. These tests all consist of running `ocamlformat` on
`.ml` files and comparing the output to expected output stored in reference files. The `dune`
configuration for this is automatically generated for you based on the files present in these directories.
The most tests of `ocamlformat` are so called "golden" or "expect" tests. These
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is a small typo here

Copy link
Collaborator

@Julow Julow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's really awesome ! I added some suggestions but your addition is already better than what we had before.

CONTRIBUTING.md Outdated

To add a test showing currently incorrect behavior, add a `.ml` file to
`test/failing/tests`. If command line arguments are needed, create a
corresponding `.opts` file with the same base name. The output of these tests
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Base name is ambiguous here, I think you should use entire file names. For example, it's not mytest.opts but mytest.ml.opts

output to expected output stored in reference files. The `dune` configuration
for this is automatically generated for you based on the files present in these
directories.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be useful to mention running dune runtest here. The linked "Running the Tests" section talks about several things but tests added following this guide is specifically run with dune runtest.

@EmileTrotignon EmileTrotignon added the no changelog set this to bypass the CI check for changelog entries label Nov 4, 2025
Copy link
Collaborator

@EmileTrotignon EmileTrotignon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI failures are weird and look unrelated to this PR. I think this is ready to be merged.

@WardBrian
Copy link
Contributor Author

The test failures on those platforms have been coming and going on different commits, most of which are only updating the markdown, so I agree.

Let me know if there is anything else needed to merge this!

@EmileTrotignon EmileTrotignon merged commit 7ec4b50 into ocaml-ppx:main Nov 5, 2025
11 of 13 checks passed
@WardBrian WardBrian deleted the bmw/tests-and-contributing branch November 5, 2025 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog set this to bypass the CI check for changelog entries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants