Skip to content

Commit

Permalink
Tests: Print stderr of invoked programs.
Browse files Browse the repository at this point in the history
Makes debugging failing tests much easier.
  • Loading branch information
nh2 committed Sep 12, 2013
1 parent 6a0bb83 commit c6550a2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/Tests.hs
Expand Up @@ -97,7 +97,9 @@ getExitCode :: FilePath -> [String] -> FilePath -> IO ExitCode
getExitCode program args workingDir =
do bracket (runInteractiveProcess program args (Just workingDir) Nothing)
(\(inh, outh, errh, _) -> mapM_ hClose [inh, outh, errh])
(\(_,_,_,pid) -> waitForProcess pid)
(\(_,_,errh,pid) -> do exitCode <- waitForProcess pid
hGetContents errh >>= putStrLn
return exitCode)

mkTestCase :: FilePath -> Int -> Assertion
mkTestCase dirName numJobs =
Expand Down

0 comments on commit c6550a2

Please sign in to comment.