File: Test.hs

package info (click to toggle)
haskell-happstack-server 7.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 476 kB
  • sloc: haskell: 4,820; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 646 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module Main where

import Happstack.Server.Tests (allTests)
import Test.HUnit (errors, failures, putTextToShowS,runTestText, runTestTT)
import System.Exit (exitFailure)
import System.IO (hIsTerminalDevice, stdout)

-- |A simple driver for running the local test suite.
main :: IO ()
main =
    do c <- do istty <- hIsTerminalDevice stdout
               if istty
                  then runTestTT allTests
                  else do (c,st) <- runTestText putTextToShowS allTests
                          putStrLn (st "")
                          return c
       case (failures c) + (errors c) of
         0 -> return ()
         n -> exitFailure