[commit: packages/time] master: attempt to get cabal test working (843ed89)

git at git.haskell.org git at git.haskell.org
Sun Dec 20 07:50:43 UTC 2015


Repository : ssh://git@git.haskell.org/time

On branch  : master
Link       : http://git.haskell.org/packages/time.git/commitdiff/843ed89f8f3d46ddabe04f1ea8ccf33426a13c92

>---------------------------------------------------------------

commit 843ed89f8f3d46ddabe04f1ea8ccf33426a13c92
Author: Ashley Yakeley <ashley at semantic.org>
Date:   Wed Dec 20 02:12:54 2006 -0800

    attempt to get cabal test working
    
    darcs-hash:20061220101254-ac6dd-56f6ff37f578c96f352ca61032eaf269e727bdf9


>---------------------------------------------------------------

843ed89f8f3d46ddabe04f1ea8ccf33426a13c92
 Setup.hs      | 19 +++++++++++++++++--
 test/Makefile |  8 ++++----
 2 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/Setup.hs b/Setup.hs
index 60804b2..2859262 100644
--- a/Setup.hs
+++ b/Setup.hs
@@ -1,6 +1,21 @@
 module Main (main) where
 
-import Distribution.Simple (defaultMainWithHooks, defaultUserHooks)
+import Distribution.Simple
+import Distribution.PackageDescription
+import Distribution.Simple.LocalBuildInfo
+import System.Exit
+import System.Cmd
+import System.Directory
+import Control.Exception
+
+withCurrentDirectory :: FilePath -> IO a -> IO a
+withCurrentDirectory path f = do
+	cur <- getCurrentDirectory
+	setCurrentDirectory path
+	finally f (setCurrentDirectory cur)
+
+runTestScript :: Args -> Bool -> PackageDescription -> LocalBuildInfo -> IO ExitCode
+runTestScript args flag pd lbi = withCurrentDirectory "test" (system "make")
 
 main :: IO ()
-main = defaultMainWithHooks defaultUserHooks
+main = defaultMainWithHooks defaultUserHooks{runTests = runTestScript}
diff --git a/test/Makefile b/test/Makefile
index c3f2992..ff2454b 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -1,6 +1,6 @@
 GHC = ghc
-GHCFLAGS = 
-LIBS = ../../dist/build/libHStime-1.0.a
+GHCFLAGS = -i../dist/build
+LIBS = ../dist/build/libHStime-1.0.a
 
 default: CurrentTime.run ShowDST.run test
 
@@ -88,10 +88,10 @@ clean:
 	@:
 
 %.o: %.hs
-	ghc -i.. -c $< -o $@
+	$(GHC) $(GHCFLAGS) -c $< -o $@
 
 %.o: %.lhs
-	ghc -i.. -c $< -o $@
+	$(GHC) $(GHCFLAGS) -c $< -o $@
 
 FORCE:
 



More information about the ghc-commits mailing list