-
Notifications
You must be signed in to change notification settings - Fork 165
/
Main.hs
58 lines (49 loc) · 1.5 KB
/
Main.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
48
49
50
51
52
53
54
55
56
57
58
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE MultiWayIf #-}
module Main (main) where
import Data.String.QQ (s)
import System.Environment (getArgs)
import Test.Framework (htfMain)
import License
import qualified SucceedLBNFTests
import qualified FailLBNFTests
import qualified ParameterizedTests
import qualified PygmentsTests
import qualified RegressionTests
import qualified OutputParser
main = do
args <- getArgs
if | "--license" `elem` args -> greet license
| "--help" `elem` args -> greet usage
| "-h" `elem` args -> greet usage
| otherwise -> runAllTests
greet :: String -> IO ()
greet msg = do
putStrLn "bnfc-system-tests: Runs BNFC system testsuite."
putStrLn ""
putStr msg
usage :: String
usage = [s|
Start bnfc-system-tests from inside `testing` directory.
Options:
--license Print copyright and license text.
--help, -h Print this help text.
|]
runAllTests = do
succeedLBNFTests <- SucceedLBNFTests.all
failLBNFTests <- FailLBNFTests.all
htfMain $
-- Use : and [] for this list such that lines can be swapped swiftly
-- (avoids the usual problems when trying to switch the first line
-- with a later line).
succeedLBNFTests :
failLBNFTests :
-- ParameterizedTests.layoutTest :
ParameterizedTests.current : -- Uncomment for prioritized test case.
-- RegressionTests.current :
ParameterizedTests.all :
RegressionTests.all :
ParameterizedTests.layoutTest :
OutputParser.tests :
PygmentsTests.all :
[]