Skip to content

Commit 7dcaf82

Browse files
committed
Ported distributed-process-client-server
1 parent fb97b0f commit 7dcaf82

File tree

4 files changed

+15
-16
lines changed

4 files changed

+15
-16
lines changed

packages/distributed-process-client-server/distributed-process-client-server.cabal

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,9 @@ test-suite ManagedProcessTests
8787
binary >= 0.8 && < 0.9,
8888
deepseq,
8989
network >= 2.3 && < 3.3,
90-
HUnit >= 1.2 && < 2,
9190
stm,
92-
test-framework >= 0.6 && < 0.9,
93-
test-framework-hunit,
91+
tasty >= 1.5 && <1.6,
92+
tasty-hunit >=0.10 && <0.11,
9493
transformers,
9594
ghc-prim,
9695
exceptions
@@ -125,10 +124,9 @@ test-suite PrioritisedProcessTests
125124
binary,
126125
deepseq,
127126
network,
128-
HUnit,
129127
stm,
130-
test-framework,
131-
test-framework-hunit,
128+
tasty >= 1.5 && <1.6,
129+
tasty-hunit >=0.10 && <0.11,
132130
transformers,
133131
ghc-prim,
134132
exceptions

packages/distributed-process-client-server/tests/TestManagedProcess.hs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ import MathsDemo
2626
import Counter
2727
import qualified SafeCounter as SafeCounter
2828

29-
import Test.Framework (Test, testGroup)
30-
import Test.Framework.Providers.HUnit (testCase)
29+
import Test.Tasty (TestTree, testGroup)
30+
import Test.Tasty.HUnit (testCase)
3131
import TestUtils
3232
import ManagedProcessCommon
3333

@@ -210,13 +210,14 @@ testCounterExceedsLimit result = do
210210
]
211211
stash result (r /= DiedNormal)
212212

213-
tests :: NT.Transport -> IO [Test]
213+
tests :: NT.Transport -> IO TestTree
214214
tests transport = do
215215
localNode <- newLocalNode transport initRemoteTable
216216
scpid <- newEmptyMVar
217217
_ <- forkProcess localNode $ SafeCounter.startCounter 5 >>= stash scpid
218218
safeCounter <- takeMVar scpid
219-
return [
219+
return $
220+
testGroup "" [
220221
testGroup "Basic Client/Server Functionality" [
221222
testCase "basic call with explicit server reply"
222223
(delayedAssertion

packages/distributed-process-client-server/tests/TestPrioritisedProcess.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ import Data.List (isInfixOf)
3838
import Data.Maybe (isNothing, isJust)
3939
import Data.Typeable (Typeable)
4040

41-
import Test.Framework (Test, testGroup)
42-
import Test.Framework.Providers.HUnit (testCase)
41+
import Test.Tasty (TestTree, testGroup)
42+
import Test.Tasty.HUnit (testCase)
4343
import TestUtils
4444
import ManagedProcessCommon
4545

@@ -534,10 +534,10 @@ testCallPrioritisation result = do
534534
let ms = rights st
535535
stash result $ ms == ["we do prioritise", "the longest", "commands", "first"]
536536

537-
tests :: NT.Transport -> IO [Test]
537+
tests :: NT.Transport -> IO TestTree
538538
tests transport = do
539539
localNode <- newLocalNode transport initRemoteTable
540-
return [
540+
return $ testGroup "" [
541541
testGroup "basic server functionality matches un-prioritised processes" [
542542
testCase "basic call with explicit server reply"
543543
(delayedAssertion

packages/distributed-process-client-server/tests/TestUtils.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import Control.Distributed.Process.Node
1818
import Control.Distributed.Process.Extras
1919
import Control.Distributed.Process.Extras.Time
2020
import Control.Distributed.Process.Extras.Timer
21-
import Test.Framework (Test, defaultMain)
21+
import Test.Tasty (TestTree, defaultMain)
2222

2323
import Network.Transport.TCP
2424
import qualified Network.Transport as NT
@@ -41,7 +41,7 @@ mkNode port = do
4141
newLocalNode transport1 initRemoteTable
4242

4343
-- | Given a @builder@ function, make and run a test suite on a single transport
44-
testMain :: (NT.Transport -> IO [Test]) -> IO ()
44+
testMain :: (NT.Transport -> IO TestTree) -> IO ()
4545
testMain builder = do
4646
Right (transport, _) <- createTransportExposeInternals (defaultTCPAddr "127.0.0.1" "0") defaultTCPParameters
4747
testData <- builder transport

0 commit comments

Comments
 (0)