Testo is an industry-grade test framework for OCaml. It is suitable for unit-testing OCaml code and for end-to-end testing command-line executables. Testo is an open-source project maintained by the OCaml community, with support from Semgrep.
$ opam update
$ opam install testo
$ git clone https://github.com/semgrep/testo-template.git
$ cd testo-template
$ dune build
$ ./test
Copy the template and adapt it as needed.

A successful test run

The output of ./test status -a

A test failure showing a CRLF issue