Source

hs-gray-code / test.hs

module Main where

import Control.Monad (unless)
import Test.QuickCheck.Test (verboseCheckResult, quickCheckResult, isSuccess)
import System.Exit (exitFailure)
import System.Environment (getArgs)

import Codec.Binary.Gray_props

main = do
  args <- getArgs
  let testsResult = if (("-v" `elem` args) || ("--verbose" `elem` args))
                    then verboseCheckResult
                    else quickCheckResult
  result <- testsResult all_props
  unless (isSuccess result) $ do
         print result
         exitFailure