package qcheck-ounit
Install
Dune Dependency
Authors
Maintainers
Sources
md5=134c6b4ffc90076eef3041dbc01181f1
sha512=eab2f5a4ef79d061c2c708ea481b735f106752b1c7797b61d5d3c11e5003e57c103b0e3260e2797521d4faa6f4d9d6ce343b499d032fd65fd1bba4a94ab996eb
doc/qcheck-ounit/QCheck_ounit/index.html
Module QCheck_ounit
Source
Conversion of tests to OUnit Tests
val to_ounit_test :
?verbose:bool ->
?long:bool ->
?rand:Random.State.t ->
QCheck.Test.t ->
OUnit.test
to_ounit_test ~rand t
wraps t
into a OUnit test
val to_ounit_test_cell :
?verbose:bool ->
?long:bool ->
?rand:Random.State.t ->
_ QCheck.Test.cell ->
OUnit.test
Same as to_ounit_test
but with a polymorphic test cell
Same as OUnit.>:::
but with a list of QCheck tests
to_ounit2_test ?rand t
wraps t
into a OUnit2 test
to_ounit2_test_list ?rand t
like to_ounit2_test
but for a list of tests
OUnit runners
QCheck provides some custom runners for OUnit tests.
Note that OUnit.run_test_tt
or OUnit.run_test_tt_main
can be used as well, in particular when QCheck tests are mixed with normal unit tests.
For OUnit2 you can use OUnit2.run_test_tt_main
.
run test
runs the test, and returns an error code that is 0
if all tests passed, 1
otherwise. This is the default runner used by the comment-to-test generator.
This test runner displays execution in a compact way, making it good for suites that have lots of tests.
Output example:
random seed: 101121210 random seed: 101121210 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ Error: tests>error_raise_exn test `error_raise_exn` raised exception `QCheck_ounit_test.Error` on `0 (after 62 shrink steps)` Raised at file "example/QCheck_ounit_test.ml", line 19, characters 20-25 Called from file "src/QCheck.ml", line 846, characters 13-33 /////////////////////////////////////////////////////////////////////////////// \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ Failure: tests>fail_sort_id fail_sort_id /////////////////////////////////////////////////////////////////////////////// Ran: 4 tests in: 0.74 seconds. WARNING! SOME TESTS ARE NEITHER SUCCESSES NOR FAILURES!
TAP-compatible test runner, in case we want to use a test harness. It prints one line per test.