aboutsummaryrefslogtreecommitdiff
path: root/haddock-test/src/Test
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2016-05-10 15:58:33 +0200
committerBen Gamari <ben@smart-cactus.org>2016-05-10 18:13:25 +0200
commitdd9a30f4d27d5fdac501d8b05ea4c6794cfae262 (patch)
tree2b12214eca4734c16c5ed1f83b334e4ce226f559 /haddock-test/src/Test
parentfea4b0a3589ad67d72594b16ceb0e6922e7f2bb8 (diff)
haddock-test: A bit of refactoring for debuggability
Diffstat (limited to 'haddock-test/src/Test')
-rw-r--r--haddock-test/src/Test/Haddock.hs19
-rw-r--r--haddock-test/src/Test/Haddock/Process.hs1
2 files changed, 11 insertions, 9 deletions
diff --git a/haddock-test/src/Test/Haddock.hs b/haddock-test/src/Test/Haddock.hs
index 6041c77c..f372f773 100644
--- a/haddock-test/src/Test/Haddock.hs
+++ b/haddock-test/src/Test/Haddock.hs
@@ -79,15 +79,16 @@ runHaddock cfg@(Config { .. }) = do
putStrLn "Generating documentation..."
forM_ cfgPackages $ \tpkg -> do
haddockStdOut <- openFile cfgHaddockStdOut WriteMode
- handle <- runProcess' cfgHaddockPath $ processConfig
- { pcArgs = concat
- [ cfgHaddockArgs
- , pure $ "--odir=" ++ outDir cfgDirConfig tpkg
- , tpkgFiles tpkg
- ]
- , pcEnv = Just $ cfgEnv
- , pcStdOut = Just $ haddockStdOut
- }
+ let pc = processConfig
+ { pcArgs = concat
+ [ cfgHaddockArgs
+ , pure $ "--odir=" ++ outDir cfgDirConfig tpkg
+ , tpkgFiles tpkg
+ ]
+ , pcEnv = Just $ cfgEnv
+ , pcStdOut = Just $ haddockStdOut
+ }
+ handle <- runProcess' cfgHaddockPath pc
waitForSuccess "Failed to run Haddock on specified test files" handle
diff --git a/haddock-test/src/Test/Haddock/Process.hs b/haddock-test/src/Test/Haddock/Process.hs
index ae720f6f..52bf9533 100644
--- a/haddock-test/src/Test/Haddock/Process.hs
+++ b/haddock-test/src/Test/Haddock/Process.hs
@@ -22,6 +22,7 @@ data ProcessConfig = ProcessConfig
, pcStdOut :: Maybe Handle
, pcStdErr :: Maybe Handle
}
+ deriving (Show)
processConfig :: ProcessConfig