summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-11-18 14:11:18 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-11-18 14:11:18 -0400
commitfbd1cbf2c915bdb18a09264b356eed55752bb757 (patch)
tree9918680f4fb334b1d7592130aef4bcbe16c6cab0
parentb6ecfc916ed46c3d84717ab5097f4731c986c2fa (diff)
tweak
-rw-r--r--configure.hs18
1 files changed, 13 insertions, 5 deletions
diff --git a/configure.hs b/configure.hs
index d9ce60a14..b9ea2344f 100644
--- a/configure.hs
+++ b/configure.hs
@@ -49,9 +49,9 @@ testEnd :: Bool -> IO ()
testEnd r = putStrLn $ " " ++ (show r)
writeSysConfig :: [Config] -> IO ()
-writeSysConfig config = do
- writeFile "SysConfig.hs" $ unlines $ header ++ map show config ++ footer
+writeSysConfig config = writeFile "SysConfig.hs" body
where
+ body = unlines $ header ++ map show config ++ footer
header = [
"{- Automatically generated by configure. -}"
, "module SysConfig where"
@@ -68,10 +68,18 @@ runTests ((TestDesc tname key t):ts) = do
rest <- runTests ts
return $ (Config key val):rest
-main :: IO ()
-main = do
+setup :: IO ()
+setup = do
createDirectoryIfMissing True tmpDir
writeFile testFile "test file contents"
- config <- runTests tests
+
+cleanup :: IO ()
+cleanup = do
removeDirectoryRecursive tmpDir
+
+main :: IO ()
+main = do
+ setup
+ config <- runTests tests
writeSysConfig config
+ cleanup