Commits

Anonymous committed ff19772

LibZip.cabal: fix tests by using cabal testsuite

  • Participants
  • Parent commits 22ee351
  • Branches 0.10-bindings-libzip

Comments (0)

Files changed (2)

File LibZip/LibZip.cabal

   This package allows to use it from Haskell code.
 
 Build-Type:     Simple
-Cabal-Version:  >= 1.2.3
+Cabal-Version:  >= 1.8
 Tested-With:    GHC == 7.4.1, GHC == 7.6.1
 
 Extra-Source-Files:
     , mtl
   GHC-Options:
       -Wall
+
+Test-Suite test-libzip
+  Type:                 exitcode-stdio-1.0
+  Main-Is:              runTests.hs
+  Build-Depends:
+      LibZip
+    , base >= 3 && < 5
+    , bindings-libzip >= 0.10 && < 0.11
+    , directory
+    , filepath
+    , HUnit
+    , mtl
+    , time

File LibZip/Setup.lhs

 #!/usr/bin/env runhaskell
+> module Main where
+>
 > import Distribution.Simple
-> import System.Cmd (system)
-> import System.Exit (ExitCode(..))
-> import Distribution.PackageDescription (emptyHookedBuildInfo)
 >
-> main = defaultMainWithHooks simpleUserHooks
->   { runTests = runUnitTests
->   }
->
->
-> runUnitTests _ _ _ _ =
->   system "runhaskell -lzip -fno-warn-warnings-deprecations 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
+> main :: IO ()
+> main = defaultMain