From 9ac76cff3508cf2e2ea9328dedbf66d996693aef Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Fri, 31 Jul 2009 17:03:35 +0000 Subject: [PATCH] make cabal test run our unit tests --- Setup.hs | 10 +++++++++- hledger.cabal | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Setup.hs b/Setup.hs index 1f13f5e0f..3bfddb58e 100644 --- a/Setup.hs +++ b/Setup.hs @@ -1,4 +1,12 @@ #!/usr/bin/env runhaskell import Distribution.Simple +import Distribution.Simple.LocalBuildInfo +import Distribution.PackageDescription +import System.FilePath +import System.Process -main = defaultMain +main = defaultMainWithHooks $ simpleUserHooks{runTests=runTests'} + +runTests' :: Args -> Bool -> PackageDescription -> LocalBuildInfo -> IO () +runTests' _ _ _ lbi = system testprog >> return () + where testprog = (buildDir lbi) "hledger" "hledger test" diff --git a/hledger.cabal b/hledger.cabal index ad58d812d..f829e002b 100644 --- a/hledger.cabal +++ b/hledger.cabal @@ -21,7 +21,7 @@ bug-reports: http://code.google.com/p/hledger/issues stability: experimental tested-with: GHC==6.8, GHC==6.10 cabal-version: >= 1.2 -build-type: Simple +build-type: Custom extra-tmp-files: extra-source-files: