Cabal and testing

Neil Mitchell ndmitchell at
Sat Aug 4 12:54:13 EDT 2007


I'm just about to hook up Cabal for doing some testing, so I started
with the obvious template:

import Distribution.Simple
main = defaultMainWithHooks defaultUserHooks{runTests=test}

test :: Args -> Bool -> PackageDescription -> LocalBuildInfo -> IO ExitCode
test args bool pd lbi = return ExitSuccess

A few questions about this interface:

1) What on earth is "bool"? Perhaps either a haddock comment, or a
type alias would make it more clear.

2) If the tests fail to run, ExitFailure would be appropriate. If the
tests run and pass then ExitSuccess seems sensible. If the tests run,
but fail, what should be returned?

3) On failure should I "print" something, or just "error" out?



More information about the cabal-devel mailing list