[Haskell-beginners] edit-compile-test loop

Roel van Dijk vandijk.roel at gmail.com
Mon Oct 19 07:25:20 EDT 2009


> [1] right now I use my own little hacked up testrunning script (just loads
> the stuff in ghci, and I have one function that sits in a base "test"
> directory, underwhich the project module hierarchy is mirrored. So if I
> have, as I do now, Text/HWN/Parser/HWN.hs, then I also have
> Test/Text/HWN/Parser/HWN_Test.hs. in the Test directory I have
> Test_Harness.hs, which has a main function which runs all the tests in the
> directories below it. Each directory has a similar Test_Harness.hs (though
> all the names are different) which loads all the tests of the directories
> below it, and exports a single test group. All of this is manual, though
> I've been planning a kind of manager thing for it lately. But thats a story
> for another day.

I found the test-framework package to be quite useful for this.

http://batterseapower.github.com/test-framework/

Using the defaultMain function you can easily define a small program
which will run all your tests (quickcheck, hunit or other). The only
problem I had with test-framework is that it prints the test results
in nice colours. It looks pretty in a console but unreadable in ghci.

Hackage seems to be down at the moment, but you can check out which
other packages use test-framework on my hackage plaything:

http://bifunctor.homelinux.net/~roel/cgi-bin/hackage-scripts/revdeps/test-framework

Roel


More information about the Beginners mailing list