git.iko.soy/distributed-process
on master help sign in
Fix up compiler warnings
c2b515cTim Watson
distributed-process-tests/distributed-process-tests.cabal+3−2
@@ -31,6 +31,7 @@ library
31 bytestring >= 0.9 && < 0.12,
31 bytestring >= 0.9 && < 0.12,
32 distributed-process >= 0.6.0 && < 0.8,
32 distributed-process >= 0.6.0 && < 0.8,
33 distributed-static,
33 distributed-static,
34+ exceptions >= 0.5,
34 HUnit >= 1.2 && < 1.7,
35 HUnit >= 1.2 && < 1.7,
35 network-transport >= 0.4.1.0 && < 0.6,
36 network-transport >= 0.4.1.0 && < 0.6,
36 network >= 2.5 && < 2.9,
37 network >= 2.5 && < 2.9,
@@ -125,7 +126,7 @@ Test-Suite TestMxInMemory
125 network-transport-inmemory >= 0.5,
126 network-transport-inmemory >= 0.5,
126 test-framework >= 0.6 && < 0.9
127 test-framework >= 0.6 && < 0.9
127 Extensions: CPP
128 Extensions: CPP
128− ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind
129+ ghc-options: -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind
129 HS-Source-Dirs: tests
130 HS-Source-Dirs: tests
130
131
131Test-Suite TestTracingInMemory
132Test-Suite TestTracingInMemory
@@ -139,7 +140,7 @@ Test-Suite TestTracingInMemory
139 network-transport-inmemory >= 0.5,
140 network-transport-inmemory >= 0.5,
140 test-framework >= 0.6 && < 0.9
141 test-framework >= 0.6 && < 0.9
141 Extensions: CPP
142 Extensions: CPP
142− ghc-options: -Wall -eventlog -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind
143+ ghc-options: -eventlog -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind
143 HS-Source-Dirs: tests
144 HS-Source-Dirs: tests
144
145
145Test-Suite TestMxInTCP
146Test-Suite TestMxInTCP
distributed-process-tests/src/Control/Distributed/Process/Tests/CH.hs+13−8
@@ -25,13 +25,18 @@ import Control.Concurrent.MVar
25 )
25 )
26import Control.Monad (replicateM_, replicateM, forever, void, unless, join)
26import Control.Monad (replicateM_, replicateM, forever, void, unless, join)
27import Control.Exception (SomeException, throwIO, ErrorCall(..))
27import Control.Exception (SomeException, throwIO, ErrorCall(..))
28−import qualified Control.Exception as Ex (catch)
28+import Control.Monad.Catch (try, catch, finally, mask, onException)
29−import Control.Applicative ((<$>), (<*>), pure, (<|>))
29+import Control.Applicative ((<|>))
30import qualified Network.Transport as NT (closeEndPoint, EndPointAddress)
30import qualified Network.Transport as NT (closeEndPoint, EndPointAddress)
31−import Control.Distributed.Process
31+import Control.Distributed.Process hiding
32+ ( try
33+ , catch
34+ , finally
35+ , mask
36+ , onException
37+ )
32import Control.Distributed.Process.Internal.Types
38import Control.Distributed.Process.Internal.Types
33− ( NodeId(nodeAddress)
34− , LocalNode(localEndPoint)
39+ ( LocalNode(localEndPoint)
35 , ProcessExitException(..)
40 , ProcessExitException(..)
36 , nullProcessId
41 , nullProcessId
37 , createUnencodedMessage
42 , createUnencodedMessage
@@ -68,7 +73,7 @@ expectThat a matcher = case res of
68forkTry :: IO () -> IO ThreadId
73forkTry :: IO () -> IO ThreadId
69forkTry p = do
74forkTry p = do
70 tid <- myThreadId
75 tid <- myThreadId
71− forkIO $ Ex.catch p (\e -> throwTo tid (e :: SomeException))
76+ forkIO $ catch p (\e -> throwTo tid (e :: SomeException))
72
77
73-- | The ping server from the paper
78-- | The ping server from the paper
74ping :: Process ()
79ping :: Process ()
@@ -760,8 +765,8 @@ testRemoteRegistry TestTransport{..} = do
760 (\(RegisterReply _ _ _) -> return ()) ]
765 (\(RegisterReply _ _ _) -> return ()) ]
761 registerRemoteAsync nid1 "ping" deadProcess
766 registerRemoteAsync nid1 "ping" deadProcess
762 receiveWait [
767 receiveWait [
763− matchIf (\(RegisterReply label' False (Just pid)) ->
768+ matchIf (\(RegisterReply label' False (Just pid'')) ->
764− "ping" == label' && pid == pingServer)
769+ "ping" == label' && pid'' == pingServer)
765 (\(RegisterReply _ _ _) -> return ()) ]
770 (\(RegisterReply _ _ _) -> return ()) ]
766 unregisterRemoteAsync nid1 "dead"
771 unregisterRemoteAsync nid1 "dead"
767 receiveWait [
772 receiveWait [
distributed-process-tests/src/Control/Distributed/Process/Tests/Closure.hs+1−1
@@ -522,7 +522,7 @@ testSpawnReconnect :: TestTransport -> RemoteTable -> Assertion
522testSpawnReconnect testtrans@TestTransport{..} rtable = do
522testSpawnReconnect testtrans@TestTransport{..} rtable = do
523 [node1, node2] <- replicateM 2 $ newLocalNode testTransport rtable
523 [node1, node2] <- replicateM 2 $ newLocalNode testTransport rtable
524 let nid1 = localNodeId node1
524 let nid1 = localNodeId node1
525− nid2 = localNodeId node2
525+ -- nid2 = localNodeId node2
526 done <- newEmptyMVar
526 done <- newEmptyMVar
527 iv <- newMVar (0 :: Int)
527 iv <- newMVar (0 :: Int)
528
528
distributed-process-tests/src/Control/Distributed/Process/Tests/Mx.hs−2
@@ -4,7 +4,6 @@ module Control.Distributed.Process.Tests.Mx (tests) where
4import Control.Distributed.Process.Tests.Internal.Utils
4import Control.Distributed.Process.Tests.Internal.Utils
5import Network.Transport.Test (TestTransport(..))
5import Network.Transport.Test (TestTransport(..))
6
6
7−import Control.Concurrent (threadDelay)
8import Control.Distributed.Process
7import Control.Distributed.Process
9import Control.Distributed.Process.Node
8import Control.Distributed.Process.Node
10import Control.Distributed.Process.Management
9import Control.Distributed.Process.Management
@@ -21,7 +20,6 @@ import Control.Distributed.Process.Management
21 , mxUpdateLocal
20 , mxUpdateLocal
22 , mxNotify
21 , mxNotify
23 , mxBroadcast
22 , mxBroadcast
24− , mxGetId
25 )
23 )
26import Control.Monad (void, unless)
24import Control.Monad (void, unless)
27import Control.Rematch (equalTo)
25import Control.Rematch (equalTo)
distributed-process-tests/src/Control/Distributed/Process/Tests/Receive.hs+7−8
@@ -10,13 +10,12 @@ import Network.Transport.Test (TestTransport(..))
10
10
11import Network.Transport (Transport)
11import Network.Transport (Transport)
12import Control.Distributed.Process
12import Control.Distributed.Process
13−import Control.Distributed.Process.Closure
14import Control.Distributed.Process.Node
13import Control.Distributed.Process.Node
15
14
16import Control.Monad
15import Control.Monad
17
16
18import Test.HUnit (Assertion, (@?=))
17import Test.HUnit (Assertion, (@?=))
19−import Test.Framework (Test, defaultMain)
18+import Test.Framework (Test)
20import Test.Framework.Providers.HUnit (testCase)
19import Test.Framework.Providers.HUnit (testCase)
21
20
22-- Tests:
21-- Tests:
@@ -43,7 +42,7 @@ recTest2 :: ReceivePort ()
43 -> SendPort String
42 -> SendPort String
44 -> ReceivePort String -> ReceivePort String
43 -> ReceivePort String -> ReceivePort String
45 -> Process ()
44 -> Process ()
46−recTest2 wait sync r1 r2 = do
45+recTest2 wait sync r1 _ = do
47 forever $ do
46 forever $ do
48 receiveChan wait
47 receiveChan wait
49 r <- receiveWait
48 r <- receiveWait
@@ -56,7 +55,7 @@ recTest3 :: ReceivePort ()
56 -> SendPort String
55 -> SendPort String
57 -> ReceivePort String -> ReceivePort String
56 -> ReceivePort String -> ReceivePort String
58 -> Process ()
57 -> Process ()
59−recTest3 wait sync r1 r2 = do
58+recTest3 wait sync r1 _ = do
60 forever $ do
59 forever $ do
61 receiveChan wait
60 receiveChan wait
62 r <- receiveWait
61 r <- receiveWait
@@ -69,7 +68,7 @@ recTest4 :: ReceivePort ()
69 -> SendPort String
68 -> SendPort String
70 -> ReceivePort String -> ReceivePort String
69 -> ReceivePort String -> ReceivePort String
71 -> Process ()
70 -> Process ()
72−recTest4 wait sync r1 r2 = do
71+recTest4 wait sync r1 _ = do
73 forever $ do
72 forever $ do
74 receiveChan wait
73 receiveChan wait
75 r <- receiveWait
74 r <- receiveWait
@@ -83,11 +82,11 @@ master :: Process ()
83master = do
82master = do
84 (waits,waitr) <- newChan
83 (waits,waitr) <- newChan
85 (syncs,syncr) <- newChan
84 (syncs,syncr) <- newChan
86− let go expect = do
85+ let go expected = do
87 sendChan waits ()
86 sendChan waits ()
88 r <- receiveChan syncr
87 r <- receiveChan syncr
89− liftIO $ print (r,expect, r == expect)
88+ liftIO $ print (r, expected, r == expected)
90− liftIO $ r @?= expect
89+ liftIO $ r @?= expected
91
90
92 liftIO $ putStrLn "---- Test 1 ----"
91 liftIO $ putStrLn "---- Test 1 ----"
93 (s1,r1) <- newChan
92 (s1,r1) <- newChan
distributed-process-tests/tests/runInMemory.hs−1
@@ -8,7 +8,6 @@ import Network.Transport.Test (TestTransport(..))
8import Network.Transport.InMemory
8import Network.Transport.InMemory
9import Test.Framework (defaultMainWithArgs)
9import Test.Framework (defaultMainWithArgs)
10
10
11−import Control.Concurrent (threadDelay)
12import System.Environment (getArgs)
11import System.Environment (getArgs)
13
12
14main :: IO ()
13main :: IO ()
distributed-process.cabal+1−1
@@ -21,7 +21,7 @@ Description: This is an implementation of Cloud Haskell, as described in
21
21
22 You will probably also want to install a Cloud Haskell backend such
22 You will probably also want to install a Cloud Haskell backend such
23 as distributed-process-simplelocalnet.
23 as distributed-process-simplelocalnet.
24−Tested-With: GHC==7.6.3 GHC==7.8.4 GHC==7.10.3 GHC==8.0.1
24+Tested-With: GHC==7.10.3 GHC==8.0.2 GHC==8.2.2 GHC==8.4.4
25Category: Control
25Category: Control
26extra-source-files: ChangeLog
26extra-source-files: ChangeLog
27
27
stack-ghc-7.10.3.yaml+1
@@ -14,6 +14,7 @@ extra-deps:
14- network-transport-0.5.2
14- network-transport-0.5.2
15- network-transport-inmemory-0.5.2
15- network-transport-inmemory-0.5.2
16- rematch-0.2.0.0
16- rematch-0.2.0.0
17+- exceptions-0.8.2.1 # test dependency
17
18
18flags:
19flags:
19 distributed-process-tests:
20 distributed-process-tests:
stack-ghc-8.0.2.yaml+1−1
@@ -1,5 +1,4 @@
1resolver: lts-9.21
1resolver: lts-9.21
2−
3# added -location for network-transport-tcp-0.6.0
2# added -location for network-transport-tcp-0.6.0
4# since c7fd79 broke the client facing API for createTransport :/
3# since c7fd79 broke the client facing API for createTransport :/
5
4
@@ -17,6 +16,7 @@ extra-deps:
17- network-transport-0.5.2
16- network-transport-0.5.2
18- network-transport-inmemory-0.5.2
17- network-transport-inmemory-0.5.2
19- rematch-0.2.0.0
18- rematch-0.2.0.0
19+# - exceptions-0.8.2.1 # test dependency
20
20
21flags:
21flags:
22 distributed-process-tests:
22 distributed-process-tests:
stack-ghc-8.2.2.yaml+1
@@ -14,6 +14,7 @@ extra-deps:
14- network-transport-0.5.2
14- network-transport-0.5.2
15- network-transport-inmemory-0.5.2
15- network-transport-inmemory-0.5.2
16- rematch-0.2.0.0
16- rematch-0.2.0.0
17+# - exceptions-0.8.2.1 # test dependency
17
18
18flags:
19flags:
19 distributed-process-tests:
20 distributed-process-tests:
stack.yaml+2
@@ -1,5 +1,7 @@
1resolver: lts-12.18 # Use GHC 8.4.4
1resolver: lts-12.18 # Use GHC 8.4.4
2
2
3+# TODO: we can enable nightly-2018-11-11 once PR #319 is merged
4+
3packages:
5packages:
4- '.'
6- '.'
5- distributed-process-tests/
7- distributed-process-tests/