-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMain.lhs
70 lines (55 loc) · 2.09 KB
/
Main.lhs
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
59
60
61
62
63
64
65
66
67
68
69
70
|
Module : Main
Copyright : (c) 2004 Oleg Kiselyov, Alistair Bayley
License : BSD-style
Maintainer : [email protected], [email protected]
Stability : experimental
Portability : non-portable
Simple driver module, mainly for testing.
Imports test modules and runs test suites.
This project is now hosted at haskell.org:
@darcs get <http://darcs.haskell.org/takusen>@
Invoke main like this (assuming the compiled executable is called @takusen@):
> takusen stub noperf
> takusen sqlite noperf "" "" dbname
> takusen oracle noperf "" "" dbname -- no username, so os-authenticated
> takusen mssql noperf user paswd dbname
> module Main (main) where
> import Database.Sqlite.Test.Enumerator as Sqlite
> import Database.Oracle.Test.Enumerator as Oracle
> --import Database.Test.MultiConnect as Multi
> import Database.ODBC.Test.Enumerator as ODBC
> import Database.Stub.Test.Enumerator as Stub
> --import Database.MSSqlServer.Test.Enumerator as MSSql
> import Database.PostgreSQL.Test.Enumerator as PGSql
> import System.Environment (getArgs)
> import Database.Test.Performance as Perf
> import Database.Test.Util as Util
> import Foreign.C.Test.UTF8 as UTF8
> main :: IO ()
> main = do
> args <- getArgs
> if (length args < 2)
> then showUsage
> else do
> let (impl:perf:as) = args
> doTests impl perf as
> showUsage = do
> putStrLn "usage: takusen backend {no}perf user pswd database"
> doTests impl perf args = do
> let runPerf = if perf == "perf" then Perf.RunTests else Perf.Don'tRunTests
> case lookup impl backendTests of
> Nothing -> putStrLn $ "No backend for " ++ impl ++ "."
> Just test -> test runPerf args
> backendTests :: [(String, Perf.ShouldRunTests -> [String] -> IO ())]
> backendTests =
> [ ("sqlite", Sqlite.runTest)
> , ("pgsql", PGSql.runTest)
> , ("odbc", ODBC.runTest)
> --, ("mssql", MSSql.runTest)
> , ("oracle", Oracle.runTest)
> --, ("multi", Multi.runTest)
> , ("stub", Stub.runTest)
> , ("utf8", UTF8.runTest)
> , ("util", Util.runTest)
> ]