caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] [ANN] qtest 2.2, merged with qcheck
@ 2016-04-03 12:46 Simon Cruanes
  2016-04-30 20:14 ` Manfred Lotz
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Cruanes @ 2016-04-03 12:46 UTC (permalink / raw)
  To: OCaml users

[-- Attachment #1: Type: text/plain, Size: 1718 bytes --]

Hello,

I'm very happy to announce that Qtest, a tool that allows one to write
tests in comments directly next to the tested functions
(originally developed for testing batteries-included), and QCheck, a
quickcheck clone I have been developing for a while, have been merged
in the release qtest-2.2. Qtest provides facilities to write both
unit tests (based on OUnit), as in

  (*$T [1;2;3] = List.sort compare [3;2;1] *)

and quickcheck-like random tests, as in

  (*$Q Q.(list int) (fun l -> sort l = sort (sort l)) *)

The support for random tests now relies upon qcheck. Our goal with this
merge is to provide both a tool for people who want to keep tests as
close as possible to their code (even for versions of OCaml that do not
support ppx), and a feature-full library for people who prefer to keep
their tests separate.

Documentation for qcheck (the library) can be found at
http://cedeela.fr/~simon/software/qcheck/ .
Documentation for qtest (the tool, and how to use it) can be found at
https://github.com/vincent-hugot/iTeML/blob/3bc5ecca75487771db512902d6e533ab059b8e34/README.adoc

Note that this release breaks compatibility with the previous versions
of qcheck (mostly because the `'a arbitrary` type is now much richer,
packing together a random generator, a printer, a shrinking
functions…). To upgrade tests from qcheck, it is easy to convert
a random generator into an `'a arbitrary` using `QCheck.make`.

For writing complex generators, Gabriel Scherer's library might be
useful: https://github.com/gasche/random-generator .

Cheers!

-- 
Simon Cruanes

http://weusepgp.info/
key 49AA62B6, fingerprint 949F EB87 8F06 59C6 D7D3  7D8D 4AC0 1D08 49AA 62B6

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-05-01 14:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-03 12:46 [Caml-list] [ANN] qtest 2.2, merged with qcheck Simon Cruanes
2016-04-30 20:14 ` Manfred Lotz
2016-05-01 13:35   ` Manfred Lotz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).