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
|