-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTestRunner.hs
47 lines (38 loc) · 1.24 KB
/
TestRunner.hs
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{-# LANGUAGE ExistentialQuantification #-}
module TestRunner(main) where
import System.Environment (getArgs)
import Control.Arrow ((>>>))
import Test
import Test.QuickCheck
import RewriteRules
import Bag
data Test = forall a. (Testable a) => Test String String a
tests :: [Test]
tests = [
Test "Simplify" "Idempotent"
prop_simplify_idempotent,
Test "Dedual" "Only negative atoms"
prop_dedual_onlyNegativeAtoms,
Test "Unexpt" "In Exponential Lattice"
prop_unexpt_inExponentialLattice1,
Test "Unexpt" "In Exponential Lattice"
prop_unexpt_inExponentialLattice2,
Test "Subbag" "Reflexive" prop_subbag_reflexive,
Test "Subbag" "Less" prop_subbag_less,
Test "Subbag" "More" prop_subbag_more,
Test "Parser" "Print and Parse is Identity" prop_printParse_ident
]
runTest :: Test -> IO ()
runTest (Test mod name prop) = do
let title = concat [mod, " -- ", name]
putStrLn title
quickCheckWith (stdArgs {maxSuccess = 10000}) prop
runTests :: [Test] -> IO ()
runTests tests = mapM_ runTest tests
modname :: Test -> String
modname (Test mod _ _) = mod
main = do
args <- getArgs
case args of
[m] -> runTests $ filter (modname >>> (== m)) tests
_ -> runTests tests