Skip to content

Commit e81b319

Browse files
committed
Ported distributed-process-execution
1 parent 5b37b6a commit e81b319

File tree

3 files changed

+18
-68
lines changed

3 files changed

+18
-68
lines changed

packages/distributed-process-execution/distributed-process-execution.cabal

+8-56
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,10 @@ library
4545
distributed-process-client-server >= 0.2.0 && < 0.3,
4646
binary >= 0.8 && < 0.9,
4747
deepseq >= 1.4 && < 1.7,
48-
mtl,
4948
containers >= 0.6 && < 0.8,
5049
hashable >= 1.2.0.5 && < 1.6,
5150
unordered-containers >= 0.2.3.0 && < 0.3,
52-
fingertree < 0.2,
5351
stm >= 2.4 && < 2.6,
54-
time,
55-
transformers
5652
hs-source-dirs: src
5753
exposed-modules:
5854
Control.Distributed.Process.Execution,
@@ -69,38 +65,16 @@ library
6965
test-suite ExchangeTests
7066
import: warnings
7167
type: exitcode-stdio-1.0
72-
-- x-uses-tf: true
73-
build-depends:
74-
base >= 4.14 && < 5,
75-
ansi-terminal >= 0.5 && < 1.2,
76-
containers,
77-
hashable,
78-
unordered-containers >= 0.2.3.0 && < 0.3,
68+
build-depends: base >= 4.14 && < 5,
7969
distributed-process,
8070
distributed-process-execution,
8171
distributed-process-extras,
8272
distributed-process-systest ^>= 0.4,
83-
distributed-static,
84-
bytestring,
85-
data-accessor,
86-
fingertree < 0.2,
8773
network-transport >= 0.4 && < 0.6,
88-
deepseq,
89-
mtl,
9074
network-transport-tcp >= 0.4 && < 0.9,
91-
binary >= 0.8 && < 0.9,
92-
network >= 2.3 && < 3.3,
93-
HUnit >= 1.2 && < 2,
94-
stm,
95-
time,
96-
test-framework >= 0.6 && < 0.9,
97-
test-framework-hunit,
98-
QuickCheck >= 2.4,
99-
test-framework-quickcheck2,
100-
transformers,
101-
ghc-prim
102-
hs-source-dirs:
103-
tests
75+
tasty >= 1.5 && <1.6,
76+
tasty-hunit >=0.10 && <0.11,
77+
hs-source-dirs: tests
10478
ghc-options: -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind
10579
main-is: TestExchange.hs
10680
default-language: Haskell2010
@@ -109,38 +83,16 @@ test-suite ExchangeTests
10983
test-suite MailboxTests
11084
import: warnings
11185
type: exitcode-stdio-1.0
112-
-- x-uses-tf: true
113-
build-depends:
114-
base >= 4.14 && < 5,
115-
ansi-terminal >= 0.5 && < 1.2,
116-
containers,
117-
hashable,
118-
unordered-containers >= 0.2.3.0 && < 0.3,
86+
build-depends: base >= 4.14 && < 5,
11987
distributed-process,
12088
distributed-process-execution,
12189
distributed-process-extras,
12290
distributed-process-systest ^>= 0.4,
123-
distributed-static,
124-
bytestring,
125-
data-accessor,
126-
fingertree < 0.2,
12791
network-transport >= 0.4 && < 0.6,
128-
deepseq,
129-
mtl,
13092
network-transport-tcp >= 0.4 && < 0.9,
131-
binary >= 0.8 && < 0.9,
132-
network >= 2.3 && < 3.3,
133-
HUnit >= 1.2 && < 2,
134-
stm,
135-
time,
136-
test-framework >= 0.6 && < 0.9,
137-
test-framework-hunit,
138-
QuickCheck >= 2.4,
139-
test-framework-quickcheck2,
140-
transformers,
141-
ghc-prim
142-
hs-source-dirs:
143-
tests
93+
tasty >= 1.5 && <1.6,
94+
tasty-hunit >=0.10 && <0.11,
95+
hs-source-dirs: tests
14496
ghc-options: -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind
14597
main-is: TestMailbox.hs
14698
other-modules: MailboxTestFilters

packages/distributed-process-execution/tests/TestExchange.hs

+5-6
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ import Control.Monad (void, forM, forever)
2222
import Prelude hiding (drop)
2323
import Network.Transport.TCP
2424
import qualified Network.Transport as NT
25-
import Test.Framework as TF (defaultMain, testGroup, Test)
26-
import Test.Framework.Providers.HUnit
27-
import Test.HUnit (assertEqual, assertBool)
25+
import Test.Tasty (defaultMain, testGroup, TestTree)
26+
import Test.Tasty.HUnit (assertEqual, assertBool, testCase)
2827

2928
testKeyBasedRouting :: TestResult Bool -> Process ()
3029
testKeyBasedRouting result = do
@@ -158,10 +157,10 @@ myRemoteTable :: RemoteTable
158157
myRemoteTable =
159158
Control.Distributed.Process.Extras.__remoteTable initRemoteTable
160159

161-
tests :: NT.Transport -> IO [Test]
160+
tests :: NT.Transport -> IO TestTree
162161
tests transport = do
163162
localNode <- newLocalNode transport myRemoteTable
164-
return [
163+
return $ testGroup "" [
165164
testGroup "Event Manager"
166165
[
167166
testCase "Simple Event Handlers"
@@ -187,7 +186,7 @@ main :: IO ()
187186
main = testMain $ tests
188187

189188
-- | Given a @builder@ function, make and run a test suite on a single transport
190-
testMain :: (NT.Transport -> IO [Test]) -> IO ()
189+
testMain :: (NT.Transport -> IO TestTree) -> IO ()
191190
testMain builder = do
192191
Right (transport, _) <- createTransportExposeInternals (defaultTCPAddr "127.0.0.1" "10501") defaultTCPParameters
193192
testData <- builder transport

packages/distributed-process-execution/tests/TestMailbox.hs

+5-6
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ import Prelude hiding (drop)
1717

1818
import Data.Maybe (catMaybes)
1919

20-
import Test.Framework as TF (defaultMain, testGroup, Test)
21-
import Test.Framework.Providers.HUnit
22-
import Test.HUnit (assertEqual)
20+
import Test.Tasty (defaultMain, testGroup, TestTree)
21+
import Test.Tasty.HUnit (assertEqual, testCase)
2322

2423
import qualified MailboxTestFilters (__remoteTable)
2524
import MailboxTestFilters (myFilter, intFilter)
@@ -175,11 +174,11 @@ myRemoteTable =
175174
Control.Distributed.Process.Extras.__remoteTable $
176175
MailboxTestFilters.__remoteTable initRemoteTable
177176

178-
tests :: NT.Transport -> IO [Test]
177+
tests :: NT.Transport -> IO TestTree
179178
tests transport = do
180179
{- verboseCheckWithResult stdArgs -}
181180
localNode <- newLocalNode transport myRemoteTable
182-
return [
181+
return $ testGroup "" [
183182
testGroup "Dequeue/Pop Ordering"
184183
[
185184
testCase "Queue Ordering"
@@ -253,7 +252,7 @@ main :: IO ()
253252
main = testMain $ tests
254253

255254
-- | Given a @builder@ function, make and run a test suite on a single transport
256-
testMain :: (NT.Transport -> IO [Test]) -> IO ()
255+
testMain :: (NT.Transport -> IO TestTree) -> IO ()
257256
testMain builder = do
258257
Right (transport, _) <- createTransportExposeInternals (defaultTCPAddr "127.0.0.1" "10501") defaultTCPParameters
259258
testData <- builder transport

0 commit comments

Comments
 (0)