tweak
This commit is contained in:
parent
b6ecfc916e
commit
fbd1cbf2c9
1 changed files with 13 additions and 5 deletions
18
configure.hs
18
configure.hs
|
@ -49,9 +49,9 @@ testEnd :: Bool -> IO ()
|
||||||
testEnd r = putStrLn $ " " ++ (show r)
|
testEnd r = putStrLn $ " " ++ (show r)
|
||||||
|
|
||||||
writeSysConfig :: [Config] -> IO ()
|
writeSysConfig :: [Config] -> IO ()
|
||||||
writeSysConfig config = do
|
writeSysConfig config = writeFile "SysConfig.hs" body
|
||||||
writeFile "SysConfig.hs" $ unlines $ header ++ map show config ++ footer
|
|
||||||
where
|
where
|
||||||
|
body = unlines $ header ++ map show config ++ footer
|
||||||
header = [
|
header = [
|
||||||
"{- Automatically generated by configure. -}"
|
"{- Automatically generated by configure. -}"
|
||||||
, "module SysConfig where"
|
, "module SysConfig where"
|
||||||
|
@ -68,10 +68,18 @@ runTests ((TestDesc tname key t):ts) = do
|
||||||
rest <- runTests ts
|
rest <- runTests ts
|
||||||
return $ (Config key val):rest
|
return $ (Config key val):rest
|
||||||
|
|
||||||
main :: IO ()
|
setup :: IO ()
|
||||||
main = do
|
setup = do
|
||||||
createDirectoryIfMissing True tmpDir
|
createDirectoryIfMissing True tmpDir
|
||||||
writeFile testFile "test file contents"
|
writeFile testFile "test file contents"
|
||||||
config <- runTests tests
|
|
||||||
|
cleanup :: IO ()
|
||||||
|
cleanup = do
|
||||||
removeDirectoryRecursive tmpDir
|
removeDirectoryRecursive tmpDir
|
||||||
|
|
||||||
|
main :: IO ()
|
||||||
|
main = do
|
||||||
|
setup
|
||||||
|
config <- runTests tests
|
||||||
writeSysConfig config
|
writeSysConfig config
|
||||||
|
cleanup
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue