summaryrefslogtreecommitdiff
path: root/test/Main.hs
blob: 1bf24afa27c4ab4f45df4f53cbb4e9602db1f9af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{-# LANGUAGE OverloadedStrings #-}
module Main where

import           Test.Tasty
import           Test.Tasty.HUnit
import           Test.Tasty.QuickCheck
import           Test.QuickCheck.Monadic
import           Tests


--------------------------------------------------------------------------------
main :: IO ()
main = defaultMain allTests


--------------------------------------------------------------------------------
withQuickCheckDepth :: TestName -> Int -> [TestTree] -> TestTree
withQuickCheckDepth tn depth tests =
  localOption (QuickCheckTests depth) (testGroup tn tests)


--------------------------------------------------------------------------------
allTests :: TestTree
allTests = testGroup "All Tests" [
    withQuickCheckDepth "Control.Concurrent.Supervisor" 10 [
        testProperty "1 supervised thread, no exceptions" (monadicIO test1SupThreadNoEx)
      , testProperty "1 supervised thread, premature exception" (monadicIO test1SupThreadPrematureDemise)
      , testProperty "killing spree" (monadicIO testKillingSpree)
      , testProperty "cleanup" (monadicIO testSupCleanup)
      , testCase "too many restarts" testTooManyRestarts
    ]
  ]