forked from batterseapower/test-framework
-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Labels
Description
For long-running tests, it is convenient to learn which test is running even before one knows any results of the test. The console runner does not print anything until the full result is known. The following code demonstrates this:
{-# LANGUAGE MultiParamTypeClasses #-}
import Control.Concurrent
import Control.Monad
import Data.Typeable
import System.IO.Unsafe
import Test.Framework.Runners.Console
import Test.Framework.Providers.API
instance TestResultlike () Bool where testSucceeded = id
instance Testlike () Bool (IO a) where
runTest _ act = do
v <- unsafeInterleaveIO act
return (Improving () (v `seq` Finished True), return ())
testTypeName _ = "IO action"
main = defaultMain [Test "infinity" (forever (threadDelay 1000000) >> return ())]
When I run this program, I would like to see at least:
infinity:
but instead see no output.