summaryrefslogtreecommitdiff
path: root/test/Test.hs
blob: 75e6f0ac038f57b88fefa83fc2178040b32da05c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
-- This Source Code Form is subject to the terms of the Mozilla Public
-- License, v. 2.0. If a copy of the MPL was not distributed with this
-- file, You can obtain one at http://mozilla.org/MPL/2.0/.

module Main (main) where

import Control.Applicative
import Control.Exception (finally)
import CommandTests (tests)
import Database.Redis.IO
import Data.Maybe (fromMaybe)
import System.Environment
import Test.Tasty
import Prelude

import qualified System.Logger as Logger

main :: IO ()
main = do
    g <- Logger.new Logger.defSettings
    h <- fromMaybe "localhost" <$> lookupEnv "REDIS_HOST"
    p <- mkPool g (setHost h defSettings)
    defaultMain (tests p) `finally` shutdown p `finally` Logger.close g