From c6550a2936f9db3c561a9cb0b97342bcbad7a500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= Date: Thu, 12 Sep 2013 19:05:29 +0900 Subject: [PATCH] Tests: Print stderr of invoked programs. Makes debugging failing tests much easier. --- tests/Tests.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Tests.hs b/tests/Tests.hs index 37cb755..00cc91e 100644 --- a/tests/Tests.hs +++ b/tests/Tests.hs @@ -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 =