mirror of
https://github.com/barrucadu/dejafu.git
synced 2024-12-18 11:01:50 +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 Cases
|
||||||
import qualified Cases.MultiThreaded as MT
|
import Examples
|
||||||
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
|
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = defaultMain
|
main = defaultMain allTests
|
||||||
[ testGroup "Test Cases"
|
|
||||||
[ testGroup "Single Threaded" ST.tests
|
allTests :: [Test]
|
||||||
, testGroup "Multi Threaded" MT.tests
|
allTests = map (uncurry testGroup)
|
||||||
, testGroup "Litmus" L.tests
|
[ ("Test Cases", testCases)
|
||||||
]
|
, ("Examples", testExamples)
|
||||||
, testGroup "Examples"
|
|
||||||
[ testGroup "auto-update" EA.tests
|
|
||||||
, testGroup "Class Laws" EC.tests
|
|
||||||
, testGroup "Dining Philosophers" EP.tests
|
|
||||||
, testGroup "Message Logger" EL.tests
|
|
||||||
]
|
|
||||||
]
|
]
|
||||||
|
@ -19,10 +19,12 @@ cabal-version: >=1.10
|
|||||||
executable dejafu-tests
|
executable dejafu-tests
|
||||||
main-is: Main.hs
|
main-is: Main.hs
|
||||||
|
|
||||||
other-modules: Cases.SingleThreaded
|
other-modules: Cases
|
||||||
|
, Cases.SingleThreaded
|
||||||
, Cases.MultiThreaded
|
, Cases.MultiThreaded
|
||||||
, Cases.Litmus
|
, Cases.Litmus
|
||||||
|
|
||||||
|
, Examples
|
||||||
, Examples.AutoUpdate
|
, Examples.AutoUpdate
|
||||||
, Examples.ClassLaws
|
, Examples.ClassLaws
|
||||||
, Examples.Logger
|
, Examples.Logger
|
||||||
|
Loading…
Reference in New Issue
Block a user