-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.hs
More file actions
33 lines (29 loc) · 1.07 KB
/
Copy pathtest.hs
File metadata and controls
33 lines (29 loc) · 1.07 KB
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
import System.Environment
import Tests.Test
import Tests.LambdaTest
import Tests.ParserTest
import Tests.BindingTest
import Tests.DefaultTest
main :: IO ()
main = do
args <- getArgs
case args of
["lambda"] -> runTest lambdaTests
["parser"] -> runTest parserTests
["binding"] -> runTest bindingTests
["default"] -> runTest defaultTests
[] -> allTests
_ -> putStrLn "Invalid arguments"
runTest :: IO (Int, Int) -> IO ()
runTest test = do
(points, max_points) <- test
putStrLn $ "Total: " ++ show points ++ "/" ++ show max_points
allTests :: IO ()
allTests = do
(lambda_points, max_lambda_points) <- lambdaTests
(parser_points, max_parser_points) <- parserTests
(binding_points, max_binding_points) <- bindingTests
(default_points, max_default_points) <- defaultTests
let total = lambda_points + parser_points + binding_points + default_points
let max_points = max_lambda_points + max_parser_points + max_binding_points + max_default_points
putStrLn $ "Total: " ++ show total ++ "/" ++ show max_points