LibZip-0.1.0: Setup.lhs
#!/usr/bin/env runhaskell
> import Distribution.Simple
> import System.Cmd (system)
> import System.Exit (ExitCode(..))
> import Distribution.PackageDescription (emptyHookedBuildInfo)
>
> main = defaultMainWithHooks simpleUserHooks
> { runTests = runUnitTests
> }
>
>
> runUnitTests _ _ _ _ =
> system "runhaskell -lzip runTests.hs" >>=
> onExit "\nSome tests did not pass." ()
>
> onExit :: String -> a -> ExitCode -> IO a
> onExit errmsg okvalue r =
> case r of
> ExitSuccess -> return okvalue
> _ -> fail errmsg