Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions distributed-process-execution.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ library
distributed-process-supervisor >= 0.1.2 && < 0.2,
distributed-process-client-server >= 0.1.2 && < 0.2,
binary >= 0.6.3.0 && < 0.8,
deepseq >= 1.3.0.1 && < 1.4,
deepseq >= 1.3.0.1 && < 1.5,
mtl,
containers >= 0.4 && < 0.6,
hashable >= 1.2.0.5 && < 1.3,
unordered-containers >= 0.2.3.0 && < 0.3,
fingertree < 0.2,
stm >= 2.4 && < 2.5,
time > 1.4 && < 1.5,
time > 1.4 && < 1.6,
transformers
if impl(ghc <= 7.5)
Build-Depends: template-haskell == 2.7.0.0,
Expand Down Expand Up @@ -77,19 +77,20 @@ test-suite ExchangeTests
distributed-process >= 0.5.3 && < 0.6,
distributed-process-execution,
distributed-process-extras >= 0.2.0 && < 0.3,
distributed-process-tests >= 0.4.1 && < 0.5,
distributed-static,
bytestring,
data-accessor,
fingertree < 0.2,
network-transport >= 0.4 && < 0.5,
deepseq >= 1.3.0.1 && < 1.4,
deepseq >= 1.3.0.1 && < 1.5,
mtl,
network-transport-tcp >= 0.4 && < 0.5,
binary >= 0.6.3.0 && < 0.8,
network >= 2.3 && < 2.7,
HUnit >= 1.2 && < 2,
stm >= 2.3 && < 2.5,
time > 1.4 && < 1.5,
time > 1.4 && < 1.6,
test-framework >= 0.6 && < 0.9,
test-framework-hunit,
QuickCheck >= 2.4,
Expand All @@ -102,7 +103,6 @@ test-suite ExchangeTests
ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind -eventlog
extensions: CPP
main-is: TestExchange.hs
other-modules: TestUtils


test-suite MailboxTests
Expand All @@ -117,19 +117,20 @@ test-suite MailboxTests
distributed-process >= 0.5.3 && < 0.6,
distributed-process-execution,
distributed-process-extras >= 0.2.0 && < 0.3,
distributed-process-tests >= 0.4.1 && < 0.5,
distributed-static,
bytestring,
data-accessor,
fingertree < 0.2,
network-transport >= 0.4 && < 0.5,
deepseq >= 1.3.0.1 && < 1.4,
deepseq >= 1.3.0.1 && < 1.5,
mtl,
network-transport-tcp >= 0.4 && < 0.5,
binary >= 0.6.3.0 && < 0.8,
network >= 2.3 && < 2.7,
HUnit >= 1.2 && < 2,
stm >= 2.3 && < 2.5,
time > 1.4 && < 1.5,
time > 1.4 && < 1.6,
test-framework >= 0.6 && < 0.9,
test-framework-hunit,
QuickCheck >= 2.4,
Expand All @@ -143,4 +144,3 @@ test-suite MailboxTests
extensions: CPP
main-is: TestMailbox.hs
other-modules: MailboxTestFilters
TestUtils
12 changes: 10 additions & 2 deletions tests/TestExchange.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import Control.Distributed.Process.Extras.Internal.Primitives
import qualified Control.Distributed.Process.Execution.EventManager as EventManager
( start
)
import Control.Distributed.Process.Tests.Internal.Utils
import Control.Monad (void, forM, forever)
import Control.Rematch (equalTo)

Expand All @@ -23,10 +24,10 @@ import Prelude hiding (catch, drop)
#else
import Prelude hiding (drop)
#endif
import Network.Transport.TCP
import qualified Network.Transport as NT
import Test.Framework as TF (testGroup, Test)
import Test.Framework as TF (defaultMain, testGroup, Test)
import Test.Framework.Providers.HUnit
import TestUtils

testKeyBasedRouting :: TestResult Bool -> Process ()
testKeyBasedRouting result = do
Expand Down Expand Up @@ -184,3 +185,10 @@ tests transport = do
main :: IO ()
main = testMain $ tests

-- | Given a @builder@ function, make and run a test suite on a single transport
testMain :: (NT.Transport -> IO [Test]) -> IO ()
testMain builder = do
Right (transport, _) <- createTransportExposeInternals
"127.0.0.1" "10501" defaultTCPParameters
testData <- builder transport
defaultMain testData
15 changes: 12 additions & 3 deletions tests/TestMailbox.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ module Main where
import Control.Distributed.Process
import Control.Distributed.Process.Node
import qualified Control.Distributed.Process.Extras (__remoteTable)
import qualified Control.Distributed.Process.Execution.Mailbox (__remoteTable)
import Control.Distributed.Process.Execution.Mailbox
import Control.Distributed.Process.Extras.Time
import Control.Distributed.Process.Extras.Timer
import Control.Distributed.Process.Tests.Internal.Utils


import Control.Rematch (equalTo)

Expand All @@ -22,12 +23,13 @@ import Prelude hiding (drop)

import Data.Maybe (catMaybes)

import Test.Framework as TF (testGroup, Test)
import Test.Framework as TF (defaultMain, testGroup, Test)
import Test.Framework.Providers.HUnit
import TestUtils

import qualified MailboxTestFilters (__remoteTable)
import MailboxTestFilters (myFilter, intFilter)

import Network.Transport.TCP
import qualified Network.Transport as NT

-- TODO: This whole test suite would be much better off using QuickCheck.
Expand Down Expand Up @@ -254,3 +256,10 @@ tests transport = do
main :: IO ()
main = testMain $ tests

-- | Given a @builder@ function, make and run a test suite on a single transport
testMain :: (NT.Transport -> IO [Test]) -> IO ()
testMain builder = do
Right (transport, _) <- createTransportExposeInternals
"127.0.0.1" "10501" defaultTCPParameters
testData <- builder transport
defaultMain testData
234 changes: 0 additions & 234 deletions tests/TestUtils.hs

This file was deleted.