-
install opam2
-
install odoc and ounit2
sh setup-opam
dune runtest
Example output
> dune runtest test
dune runtest test
test_list alias test/runtest
..
Ran: 2 tests in: 0.11 seconds.
OK
- set OUNIT_OUTPUT_HTML_DIR and run test
mkdir -p result
OUNIT_OUTPUT_HTML_DIR=result dune runtest
- HTML report will be saved as a file
./_build/default/test/result/index.html
2 kinds of tests
- Test in a directory
test
- Inline test:
- ppx_inline_test
src
- TODO qtest
- TODO ppx_expect
- ppx_inline_test
- measure code coverage with bisect_ppx
- junit test report? (xml format)
- OUnit - xUnit testing framework for OCaml
- src/test_list.ml is copied from https://github.com/gildor478/ounit/blob/master/examples/test_list.ml
- Writing and running tests — dune documentation
Takashi Masuyama < mamewotoko@gmail.com >
https://mamewo.ddo.jp/