(Imported from Trac #938, reported by fushunpoon on 2012-04-10)
cabal test does not tail standard output of the running test executable. Instead, any output from the executable is output right at the end of the test process in one batch.
It is incredibly useful to have cabal test tail the stdout of the test executable currently being executed such that CI tools such as TeamCity? can be made to record the time it takes to run individual tests.
Run the following simple executable as a test executable with
cabal test --show-details=always
module Main where
delay = 5000000
main = do
putStrLn "First message"
putStrLn "Second message"
putStrLn "Third message"
This makes it especially difficult to debug issues when a thread is blocked, as it will just hang there with no output.
I recently added a cross-platform createPipe function in https://github.com/haskell/cabal/blob/master/Cabal/tests/Distribution/Compat/CreatePipe.hsc. We could use that to tail stdout as it's written while at the same time writing it to a file (today we only do the latter).
Awesome, that is exactly what I was missing when I wrote the offending code!
Feel free to move createPipe to somewhere more suitable.
As of #1727 you can cabal test --show-details=streaming.
cabal test --show-details=streaming