dryunit

AuthorGerson Moraes
Homepagehttps://github.com/gersonmoraes/dryunit
Issue Trackerhttps://github.com/gersonmoraes/dryunit
Maintainergerson.xp@gmail.com
Dependencies
&cmdliner>= 1.0.2
cppo
jbuilder
Availableocaml-version >= "4.02.3"
PublishedOct 21, 2017
Source [http] https://github.com/gersonmoraes/dryunit/archive/0.4.1.tar.gz
307fbc627e3fb70092ae547934b3521e
StatisticsInstalled 37 times last month.
Edithttps://github.com/ocaml/opam-repository/tree/master/packages/dryunit/dryunit.0.4.1/opam

A detection tool for traditional unit testing in OCaml

Dryunit is a generates bootstrap code for test frameworks. As a result, you get to use plain old OCaml. For more information, checkout the repository.

Installation

opam install dryunit

Conventions

  • Test files should either be called tests.ml or something_tests.ml
  • Test functions should called test_something
  • By default, test executables are named main

Usage

If you use jbuilder, you can get started using this:

mkdir tests
dryunit init > tests/jbuild

You can also define the framework explicitly using dryunit init alcotest. Adding a sample test:

echo "let test_error () = raise Not_found" > tests/something_tests.ml
jbuilder build tests/main.exe && _build/default/tests/main.exe
No package is dependent