mirror of
https://github.com/barrucadu/dejafu.git
synced 2024-12-18 02:51:42 +03:00
Organise tests a little
This commit is contained in:
parent
9e68038e2b
commit
18cb1c86c9
15
dejafu-tests/Cases.hs
Executable file
15
dejafu-tests/Cases.hs
Executable file
@ -0,0 +1,15 @@
|
||||
module Cases where
|
||||
|
||||
import Test.Framework (Test, testGroup)
|
||||
|
||||
import qualified Cases.SingleThreaded as S
|
||||
import qualified Cases.MultiThreaded as M
|
||||
import qualified Cases.Litmus as L
|
||||
|
||||
-- | Run all the test cases.
|
||||
testCases :: [Test]
|
||||
testCases = map (uncurry testGroup)
|
||||
[ ("Single Threaded", S.tests)
|
||||
, ("Multi Threaded", M.tests)
|
||||
, ("Litmus", L.tests)
|
||||
]
|
17
dejafu-tests/Examples.hs
Executable file
17
dejafu-tests/Examples.hs
Executable file
@ -0,0 +1,17 @@
|
||||
module Examples where
|
||||
|
||||
import Test.Framework (Test, testGroup)
|
||||
|
||||
import qualified Examples.AutoUpdate as A
|
||||
import qualified Examples.ClassLaws as C
|
||||
import qualified Examples.Logger as L
|
||||
import qualified Examples.Philosophers as P
|
||||
|
||||
-- | Run all the example tests.
|
||||
testExamples :: [Test]
|
||||
testExamples = map (uncurry testGroup)
|
||||
[ ("auto-update", A.tests)
|
||||
, ("Class Laws", C.tests)
|
||||
, ("Dining Philosophers", P.tests)
|
||||
, ("Message Logger", L.tests)
|
||||
]
|
@ -1,26 +1,15 @@
|
||||
module Main (main) where
|
||||
module Main where
|
||||
|
||||
import Test.Framework (defaultMain, testGroup)
|
||||
import Test.Framework (Test, defaultMain, testGroup)
|
||||
|
||||
import qualified Cases.SingleThreaded as ST
|
||||
import qualified Cases.MultiThreaded as MT
|
||||
import qualified Cases.Litmus as L
|
||||
import qualified Examples.AutoUpdate as EA
|
||||
import qualified Examples.ClassLaws as EC
|
||||
import qualified Examples.Logger as EL
|
||||
import qualified Examples.Philosophers as EP
|
||||
import Cases
|
||||
import Examples
|
||||
|
||||
main :: IO ()
|
||||
main = defaultMain
|
||||
[ testGroup "Test Cases"
|
||||
[ testGroup "Single Threaded" ST.tests
|
||||
, testGroup "Multi Threaded" MT.tests
|
||||
, testGroup "Litmus" L.tests
|
||||
]
|
||||
, testGroup "Examples"
|
||||
[ testGroup "auto-update" EA.tests
|
||||
, testGroup "Class Laws" EC.tests
|
||||
, testGroup "Dining Philosophers" EP.tests
|
||||
, testGroup "Message Logger" EL.tests
|
||||
]
|
||||
main = defaultMain allTests
|
||||
|
||||
allTests :: [Test]
|
||||
allTests = map (uncurry testGroup)
|
||||
[ ("Test Cases", testCases)
|
||||
, ("Examples", testExamples)
|
||||
]
|
||||
|
@ -19,10 +19,12 @@ cabal-version: >=1.10
|
||||
executable dejafu-tests
|
||||
main-is: Main.hs
|
||||
|
||||
other-modules: Cases.SingleThreaded
|
||||
other-modules: Cases
|
||||
, Cases.SingleThreaded
|
||||
, Cases.MultiThreaded
|
||||
, Cases.Litmus
|
||||
|
||||
, Examples
|
||||
, Examples.AutoUpdate
|
||||
, Examples.ClassLaws
|
||||
, Examples.Logger
|
||||
|
Loading…
Reference in New Issue
Block a user