[Haskell-cafe] QuickCheck properties: export or not?

Don Stewart dons at galois.com
Mon Jan 14 18:31:39 EST 2008

> Hi
> > standard "quickcheck" script.  The contributor, gwern0 at gmail.com
> > suggested an explicit test harness instead.
> Unless you have a test harness (ideally through Cabal), the properties
> will go out of sync, and you'll forget to run them. Tests are good,
> they should be able to be invoked as standard. Every time I've *not*
> done a test harness, and then relied on manually remembering things or
> putting them in the documentation, it has gone wrong very quickly!

I usually have a main = runTests file, and then use darcs to ensure the
tests are up to date:

    $ cat _darcs/prefs/prefs 
    test ghc -no-recomp -Onot -fasm -itests tests/Unit.hs --make -odir /tmp && tests/Unit

darcs will run the testsuite, and it needs to pass, before a commit will
be accepted. We do a similar thing for xmonad.

The test command to run on every commit can be set via,

    darcs setpref test "my test command"

-- Don

More information about the Haskell-Cafe mailing list