git.iko.soy/distributed-process
on master help sign in
Clean up tests
006cad8Edsko de Vries
distributed-process/distributed-process.cabal+1
@@ -35,6 +35,7 @@ Test-Suite TestCH
35 transformers,
35 transformers,
36 data-accessor,
36 data-accessor,
37 random,
37 random,
38+ ansi-terminal,
38 network-transport >= 0.1
39 network-transport >= 0.1
39 Extensions: ExplicitForAll, ScopedTypeVariables, GeneralizedNewtypeDeriving, FlexibleInstances, UndecidableInstances, MultiParamTypeClasses, DeriveDataTypeable
40 Extensions: ExplicitForAll, ScopedTypeVariables, GeneralizedNewtypeDeriving, FlexibleInstances, UndecidableInstances, MultiParamTypeClasses, DeriveDataTypeable
40 ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind
41 ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind
distributed-process/tests/TestCH.hs+6−5
@@ -9,11 +9,11 @@ import Control.Concurrent.MVar ( newEmptyMVar
9 , takeMVar
9 , takeMVar
10 , readMVar
10 , readMVar
11 )
11 )
12−import Control.Exception (catch)
13import Control.Monad (replicateM_)
12import Control.Monad (replicateM_)
14import Control.Distributed.Process
13import Control.Distributed.Process
15import qualified Network.Transport as NT (Transport)
14import qualified Network.Transport as NT (Transport)
16import Network.Transport.TCP (createTransport, defaultTCPParameters)
15import Network.Transport.TCP (createTransport, defaultTCPParameters)
16+import TestAuxiliary
17
17
18newtype Ping = Ping ProcessId
18newtype Ping = Ping ProcessId
19 deriving (Typeable, Binary, Show)
19 deriving (Typeable, Binary, Show)
@@ -55,7 +55,6 @@ testPing transport = do
55 Ping _ <- expect
55 Ping _ <- expect
56 return ()
56 return ()
57
57
58− putStrLn $ "Client did " ++ show numPings ++ " pings"
59 putMVar clientDone ()
58 putMVar clientDone ()
60
59
61
60
@@ -113,6 +112,8 @@ testMonitor2 transport = do
113main :: IO ()
112main :: IO ()
114main = do
113main = do
115 Right transport <- createTransport "127.0.0.1" "8080" defaultTCPParameters
114 Right transport <- createTransport "127.0.0.1" "8080" defaultTCPParameters
115+ runTests
116− -- testPing transport
116+ [ ("Ping", testPing transport)
117− testMonitor1 transport
117+ , ("Monitor1", testMonitor1 transport)
118− testMonitor2 transport
118+ , ("Monitor2", testMonitor2 transport)
119+ ]