From dd9a30f4d27d5fdac501d8b05ea4c6794cfae262 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Tue, 10 May 2016 15:58:33 +0200 Subject: haddock-test: A bit of refactoring for debuggability --- haddock-test/src/Test/Haddock.hs | 19 ++++++++++--------- haddock-test/src/Test/Haddock/Process.hs | 1 + 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'haddock-test/src/Test') 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 -- cgit v1.2.3