[Haskell-cafe] packages and QuickCheck

Max Bolingbroke batterseapower at hotmail.com
Tue Sep 9 12:35:46 EDT 2008


2008/9/9 Conal Elliott <conal at conal.net>:
> Hi Sean.
>
> Thanks a bunch for these tips.  I haven't used the flags feature of cabal
> before, and i don't seem to be able to get it right.  I have:
>
> Flag test
>   Description: Enable testing
>   Default:     False
>
> And I get "Warning: unamb.cabal: Unknown section type: flag ignoring...".
> If I indent, I instead get "These flags are used without having been
> defined: test".  Any idea what I'm doing wrong here?

I don't know exactly what your problem is, but perhaps you have not
specified Cabal-Version: >= 1.2?

For another example .cabal file that uses something like the technique
Sean describes you can look at my edit-distance library on GitHub:
http://github.com/batterseapower/edit-distance/tree/master/edit-distance.cabal.
It exports a library with the edit distance algorithms and a test
executable which is only buildable when configured with -ftests. I
haven't made use of the Cabal test hook, but you can run the tests
just by running that single executable: the procedure is described in
my README: http://github.com/batterseapower/edit-distance/tree/master/README.textile

My tests are making use of a nice console test runner I wrote that
supports both HUnit and QuickCheck (and is extensible to other test
providers by the user):
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/test-framework.

Cheers,
Max


More information about the Haskell-Cafe mailing list