aboutsummaryrefslogtreecommitdiff
path: root/haddock-test/src
diff options
context:
space:
mode:
authorŁukasz Hanuszczak <lukasz.hanuszczak@gmail.com>2015-08-13 13:51:23 +0200
committerŁukasz Hanuszczak <lukasz.hanuszczak@gmail.com>2015-08-22 23:40:27 +0200
commit1102352d9e830fdf6ecd8abfba50c405114d5ae2 (patch)
tree04665b61915adbf2164d2f5a4df81e91f670ba98 /haddock-test/src
parent4a4d9ecf66bcb6561f7b10c07742c4b6688332b8 (diff)
Create utilities for storing directory configuration.
Diffstat (limited to 'haddock-test/src')
-rw-r--r--haddock-test/src/Test/Haddock/Config.hs22
1 files changed, 22 insertions, 0 deletions
diff --git a/haddock-test/src/Test/Haddock/Config.hs b/haddock-test/src/Test/Haddock/Config.hs
index bb226fdb..af2a460b 100644
--- a/haddock-test/src/Test/Haddock/Config.hs
+++ b/haddock-test/src/Test/Haddock/Config.hs
@@ -8,6 +8,21 @@ import Test.Haddock.Process
import Test.Haddock.Utils
+data DirConfig = DirConfig
+ { dcfgSrcDir :: FilePath
+ , dcfgRefDir :: FilePath
+ , dcfgOutDir :: FilePath
+ }
+
+
+defaultDirConfig :: FilePath -> DirConfig
+defaultDirConfig baseDir = DirConfig
+ { dcfgSrcDir = baseDir </> "src"
+ , dcfgRefDir = baseDir </> "ref"
+ , dcfgOutDir = baseDir </> "out"
+ }
+
+
data Config = Config
{ cfgHaddockPath :: FilePath
, cfgGhcPath :: FilePath
@@ -16,9 +31,16 @@ data Config = Config
, cfgHaddockStdOut :: FilePath
, cfgDiffTool :: Maybe FilePath
, cfgEnv :: Environment
+ , cfgDirConfig :: DirConfig
}
+cfgSrcDir, cfgRefDir, cfgOutDir :: Config -> FilePath
+cfgSrcDir = dcfgSrcDir . cfgDirConfig
+cfgRefDir = dcfgRefDir . cfgDirConfig
+cfgOutDir = dcfgOutDir . cfgDirConfig
+
+
data Flag
= FlagHaddockPath FilePath
| FlagGhcPath FilePath