From 1102352d9e830fdf6ecd8abfba50c405114d5ae2 Mon Sep 17 00:00:00 2001 From: Ɓukasz Hanuszczak Date: Thu, 13 Aug 2015 13:51:23 +0200 Subject: Create utilities for storing directory configuration. --- haddock-test/src/Test/Haddock/Config.hs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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 -- cgit v1.2.3