-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSetup.hs
35 lines (29 loc) · 819 Bytes
/
Setup.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
module Main (main) where
import Distribution.Simple
import System.Exit
import System.Cmd
import System.Directory
import Control.Exception
import Control.Monad
main = defaultMain
{-
main = defaultMainWithHooks $
defaultUserHooks {
runTests = runTestScript
}
withCurrentDirectory path f = do
cur <- getCurrentDirectory
setCurrentDirectory path
finally f (setCurrentDirectory cur)
runTestScript _ _ _ _ = do
system "runghc Setup configure --prefix=test"
code <- system "runghc Setup build"
case code of
ExitFailure _ -> do
putStrLn "ERROR : Compilation failed"
exitWith (ExitFailure 1)
_ -> do return ()
system "runghc Setup copy"
withCurrentDirectory "test" (system "bin/runtest")
return ()
-}