Posts

Showing posts with the label darcs

Integrating your HUnit (or other) tests into your cabal package

As part of one my side projects I'm working on learning haskell, and creating a simple DNSBL lookup tool. An important part of any project, especially one which you plan to build on top off is its testing. There are quite a few options for Haskell testing such as quickcheck ,etc., and the one that I ended up using HUnit . Most developers that I know have been burned at one time or another by making some "trivial" change building it and checking it in to only have it fail when running there tests would have caught it. The solution of course is to integrate your automated tests into the build process. Cabal is a wonderful package build system for haskell. Unfortunately, very few (if any) people seem to use the provided mechanism for hooking in tests. The first set is opening up the Setup.hs (or lhs) file and overriding the default test hooks. Start off by importing the necessary libraries import Distribution.Simple import Distribution.PackageDescription(PackageDescription...