Skip to content

Commit 8947900

Browse files
committed
testsuite: Run all tests sequentially
Otherwise we too often encounter tests which try to open the same socket simultaneously.
1 parent 1c002c7 commit 8947900

File tree

7 files changed

+43
-27
lines changed

7 files changed

+43
-27
lines changed

changelog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
0.2.5
22
* Deprecate `NN_LINGER` option
3+
* Improve testsuite reliability
34

45
0.2.4
56
* Bumped upper bound on binary

nanomsg-haskell.cabal

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -51,39 +51,17 @@ library
5151
test-suite tests
5252
type: exitcode-stdio-1.0
5353
hs-source-dirs: tests
54-
main-is: PropDriver.hs
54+
main-is: Main.hs
5555
other-modules: BinaryProperties Properties
5656
ghc-options: -O2 -Wall -fwarn-tabs -threaded "-with-rtsopts=-N" -rtsopts
5757
default-language: Haskell2010
58-
build-tool-depends:
59-
tasty-discover:tasty-discover
6058
build-depends:
6159
base >= 4.5 && < 5,
6260
bytestring >= 0.9.0 && < 0.13,
6361
nanomsg-haskell,
6462
QuickCheck,
6563
tasty,
66-
tasty-quickcheck,
67-
tasty-discover
68-
69-
test-suite tests-binary
70-
type: exitcode-stdio-1.0
71-
hs-source-dirs: tests
72-
main-is: BinaryDriver.hs
73-
other-modules: Properties BinaryProperties
74-
ghc-options: -O2 -Wall -fwarn-tabs -threaded "-with-rtsopts=-N" -rtsopts
75-
default-language: Haskell2010
76-
build-tool-depends:
77-
tasty-discover:tasty-discover
78-
build-depends:
79-
base >= 4.5 && < 5,
80-
bytestring >= 0.9.0 && < 0.13,
81-
nanomsg-haskell,
82-
binary,
83-
QuickCheck,
84-
tasty,
85-
tasty-quickcheck,
86-
tasty-discover
64+
tasty-quickcheck
8765

8866
source-repository head
8967
type: git

tests/BinaryDriver.hs

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/BinaryProperties.hs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,3 +204,13 @@ test_options = sequentialTestGroup "options" AllFinish
204204
close sock
205205
return $ value === v
206206

207+
tests :: TestTree
208+
tests = sequentialTestGroup "BinaryProperties" AllFinish
209+
[ testProperty "reverse" prop_reverse
210+
, testProperty "PubSub" prop_PubSub
211+
, testProperty "Pair" prop_Pair
212+
, testProperty "Pipeline" prop_Pipeline
213+
, testProperty "ReqRep" prop_ReqRep
214+
, testProperty "Bus" prop_Bus
215+
]
216+

tests/Main.hs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import qualified Test.Tasty as T
2+
import qualified Test.Tasty.Ingredients as T
3+
4+
import qualified BinaryProperties
5+
import qualified Properties
6+
7+
tests :: T.TestTree
8+
tests =
9+
T.sequentialTestGroup "tests" T.AllFinish
10+
[ Properties.tests
11+
, BinaryProperties.tests
12+
]
13+
14+
ingredients :: [T.Ingredient]
15+
ingredients = T.defaultIngredients
16+
17+
main :: IO ()
18+
main = do
19+
T.defaultMainWithIngredients ingredients tests
20+

tests/PropDriver.hs

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/Properties.hs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{-# LANGUAGE TemplateHaskell #-}
21
{-# LANGUAGE ScopedTypeVariables #-}
32
{-# OPTIONS_GHC -fno-warn-orphans #-}
43
module Properties where
@@ -199,3 +198,13 @@ test_options = sequentialTestGroup "options" AllFinish
199198
close sock
200199
return $ value === v
201200

201+
tests :: TestTree
202+
tests = sequentialTestGroup "Properties" AllFinish
203+
[ testProperty "reverse" prop_reverse
204+
, testProperty "PubSub" prop_PubSub
205+
, testProperty "Pair" prop_Pair
206+
, testProperty "Pipeline" prop_Pipeline
207+
, testProperty "ReqRep" prop_ReqRep
208+
, testProperty "Bus" prop_Bus
209+
]
210+

0 commit comments

Comments
 (0)