Skip to content

Commit c2b515c

Browse files
authored
Fix up compiler warnings
Merge pull request haskell-distributed#326
2 parents 003e522 + c07a6c1 commit c2b515c

File tree

11 files changed

+30
-24
lines changed

11 files changed

+30
-24
lines changed

distributed-process-tests/distributed-process-tests.cabal

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ library
3131
bytestring >= 0.9 && < 0.12,
3232
distributed-process >= 0.6.0 && < 0.8,
3333
distributed-static,
34+
exceptions >= 0.5,
3435
HUnit >= 1.2 && < 1.7,
3536
network-transport >= 0.4.1.0 && < 0.6,
3637
network >= 2.5 && < 2.9,
@@ -125,7 +126,7 @@ Test-Suite TestMxInMemory
125126
network-transport-inmemory >= 0.5,
126127
test-framework >= 0.6 && < 0.9
127128
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
129130
HS-Source-Dirs: tests
130131

131132
Test-Suite TestTracingInMemory
@@ -139,7 +140,7 @@ Test-Suite TestTracingInMemory
139140
network-transport-inmemory >= 0.5,
140141
test-framework >= 0.6 && < 0.9
141142
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
143144
HS-Source-Dirs: tests
144145

145146
Test-Suite TestMxInTCP

distributed-process-tests/src/Control/Distributed/Process/Tests/CH.hs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,18 @@ import Control.Concurrent.MVar
2525
)
2626
import Control.Monad (replicateM_, replicateM, forever, void, unless, join)
2727
import Control.Exception (SomeException, throwIO, ErrorCall(..))
28-
import qualified Control.Exception as Ex (catch)
29-
import Control.Applicative ((<$>), (<*>), pure, (<|>))
28+
import Control.Monad.Catch (try, catch, finally, mask, onException)
29+
import Control.Applicative ((<|>))
3030
import 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+
)
3238
import Control.Distributed.Process.Internal.Types
33-
( NodeId(nodeAddress)
34-
, LocalNode(localEndPoint)
39+
( LocalNode(localEndPoint)
3540
, ProcessExitException(..)
3641
, nullProcessId
3742
, createUnencodedMessage
@@ -68,7 +73,7 @@ expectThat a matcher = case res of
6873
forkTry :: IO () -> IO ThreadId
6974
forkTry p = do
7075
tid <- myThreadId
71-
forkIO $ Ex.catch p (\e -> throwTo tid (e :: SomeException))
76+
forkIO $ catch p (\e -> throwTo tid (e :: SomeException))
7277

7378
-- | The ping server from the paper
7479
ping :: Process ()
@@ -760,8 +765,8 @@ testRemoteRegistry TestTransport{..} = do
760765
(\(RegisterReply _ _ _) -> return ()) ]
761766
registerRemoteAsync nid1 "ping" deadProcess
762767
receiveWait [
763-
matchIf (\(RegisterReply label' False (Just pid)) ->
764-
"ping" == label' && pid == pingServer)
768+
matchIf (\(RegisterReply label' False (Just pid'')) ->
769+
"ping" == label' && pid'' == pingServer)
765770
(\(RegisterReply _ _ _) -> return ()) ]
766771
unregisterRemoteAsync nid1 "dead"
767772
receiveWait [

distributed-process-tests/src/Control/Distributed/Process/Tests/Closure.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ testSpawnReconnect :: TestTransport -> RemoteTable -> Assertion
522522
testSpawnReconnect testtrans@TestTransport{..} rtable = do
523523
[node1, node2] <- replicateM 2 $ newLocalNode testTransport rtable
524524
let nid1 = localNodeId node1
525-
nid2 = localNodeId node2
525+
-- nid2 = localNodeId node2
526526
done <- newEmptyMVar
527527
iv <- newMVar (0 :: Int)
528528

distributed-process-tests/src/Control/Distributed/Process/Tests/Mx.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ module Control.Distributed.Process.Tests.Mx (tests) where
44
import Control.Distributed.Process.Tests.Internal.Utils
55
import Network.Transport.Test (TestTransport(..))
66

7-
import Control.Concurrent (threadDelay)
87
import Control.Distributed.Process
98
import Control.Distributed.Process.Node
109
import Control.Distributed.Process.Management
@@ -21,7 +20,6 @@ import Control.Distributed.Process.Management
2120
, mxUpdateLocal
2221
, mxNotify
2322
, mxBroadcast
24-
, mxGetId
2523
)
2624
import Control.Monad (void, unless)
2725
import Control.Rematch (equalTo)

distributed-process-tests/src/Control/Distributed/Process/Tests/Receive.hs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@ import Network.Transport.Test (TestTransport(..))
1010

1111
import Network.Transport (Transport)
1212
import Control.Distributed.Process
13-
import Control.Distributed.Process.Closure
1413
import Control.Distributed.Process.Node
1514

1615
import Control.Monad
1716

1817
import Test.HUnit (Assertion, (@?=))
19-
import Test.Framework (Test, defaultMain)
18+
import Test.Framework (Test)
2019
import Test.Framework.Providers.HUnit (testCase)
2120

2221
-- Tests:
@@ -43,7 +42,7 @@ recTest2 :: ReceivePort ()
4342
-> SendPort String
4443
-> ReceivePort String -> ReceivePort String
4544
-> Process ()
46-
recTest2 wait sync r1 r2 = do
45+
recTest2 wait sync r1 _ = do
4746
forever $ do
4847
receiveChan wait
4948
r <- receiveWait
@@ -56,7 +55,7 @@ recTest3 :: ReceivePort ()
5655
-> SendPort String
5756
-> ReceivePort String -> ReceivePort String
5857
-> Process ()
59-
recTest3 wait sync r1 r2 = do
58+
recTest3 wait sync r1 _ = do
6059
forever $ do
6160
receiveChan wait
6261
r <- receiveWait
@@ -69,7 +68,7 @@ recTest4 :: ReceivePort ()
6968
-> SendPort String
7069
-> ReceivePort String -> ReceivePort String
7170
-> Process ()
72-
recTest4 wait sync r1 r2 = do
71+
recTest4 wait sync r1 _ = do
7372
forever $ do
7473
receiveChan wait
7574
r <- receiveWait
@@ -83,11 +82,11 @@ master :: Process ()
8382
master = do
8483
(waits,waitr) <- newChan
8584
(syncs,syncr) <- newChan
86-
let go expect = do
85+
let go expected = do
8786
sendChan waits ()
8887
r <- receiveChan syncr
89-
liftIO $ print (r,expect, r == expect)
90-
liftIO $ r @?= expect
88+
liftIO $ print (r, expected, r == expected)
89+
liftIO $ r @?= expected
9190

9291
liftIO $ putStrLn "---- Test 1 ----"
9392
(s1,r1) <- newChan

distributed-process-tests/tests/runInMemory.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import Network.Transport.Test (TestTransport(..))
88
import Network.Transport.InMemory
99
import Test.Framework (defaultMainWithArgs)
1010

11-
import Control.Concurrent (threadDelay)
1211
import System.Environment (getArgs)
1312

1413
main :: IO ()

distributed-process.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Description: This is an implementation of Cloud Haskell, as described in
2121

2222
You will probably also want to install a Cloud Haskell backend such
2323
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
2525
Category: Control
2626
extra-source-files: ChangeLog
2727

stack-ghc-7.10.3.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ extra-deps:
1414
- network-transport-0.5.2
1515
- network-transport-inmemory-0.5.2
1616
- rematch-0.2.0.0
17+
- exceptions-0.8.2.1 # test dependency
1718

1819
flags:
1920
distributed-process-tests:

stack-ghc-8.0.2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
resolver: lts-9.21
2-
32
# added -location for network-transport-tcp-0.6.0
43
# since c7fd79 broke the client facing API for createTransport :/
54

@@ -17,6 +16,7 @@ extra-deps:
1716
- network-transport-0.5.2
1817
- network-transport-inmemory-0.5.2
1918
- rematch-0.2.0.0
19+
# - exceptions-0.8.2.1 # test dependency
2020

2121
flags:
2222
distributed-process-tests:

stack-ghc-8.2.2.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ extra-deps:
1414
- network-transport-0.5.2
1515
- network-transport-inmemory-0.5.2
1616
- rematch-0.2.0.0
17+
# - exceptions-0.8.2.1 # test dependency
1718

1819
flags:
1920
distributed-process-tests:

0 commit comments

Comments
 (0)