Skip to content

Conversation

@spotandjake
Copy link
Member

This is just a draft as I'm not sure we are going to want to merge this work, and I'm not finished writing the implementation.

I noticed that we are not testing a bunch of the binaryen api, and while we do not care too much about testing behaviour as binaryen does that downstream, we probably want to be calling every function to ensure that our api is correct.

This is an effort to rewrite our test suite to cover every function.

Notes:

  • I decided to use reasonML over OCaml as it makes reading the code a little nicer.
    • We can easily format it to OCaml if we don't like it.
  • I am also documenting the binaryen api as I go (I'll move these changes out into a separate pr once I am done).
  • I wanted to use rely, but I can't as it's not available on opam for our opam tests, so instead I just made a little helper framework to make splitting the tests up into unit tests a little nicer.
  • I am trying to test things individually to help with understanding what is failing and why, rather than the 2 module approach we previously had, where it could be hard to tell why something changed exactly.

Closes: #244

@spotandjake spotandjake self-assigned this Dec 6, 2025
@spotandjake spotandjake added enhancement New feature or request Tests Issues or pull requests relating to tests. labels Dec 6, 2025
spotandjake added a commit to spotandjake/binaryen.ml that referenced this pull request Dec 13, 2025
While working on grain-lang#265 I noticed that I was getting errors on `caml_binaryen_add_custom_section` as `caml_array_of_string` was deprecated for `caml_uint8_array_of_string` this updates that. The reason this doesn't appear for us is because of our test suite never calls this function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Tests Issues or pull requests relating to tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Audit tests

1 participant