{-|
Module      : Options
Description : Option spec for TLT
Copyright   : (c) John Maraist, 2022
License     : GPL3
Maintainer  : haskell-tlt@maraist.org
Stability   : experimental
Portability : POSIX

Options representation for the @TLT@ testing system.  See `Test.TLT`
for more information.

-}

module Test.TLT.Options where

-- |Record of options which may be specified for running and reporting
-- TLT tests.
data TLTopts = TLTopts {
  TLTopts -> Bool
optShowPasses :: Bool,
  TLTopts -> Bool
optQuitAfterFailReport :: Bool
}

-- |Default initial options.
defaultOpts :: TLTopts
defaultOpts = Bool -> Bool -> TLTopts
TLTopts Bool
False Bool
True

-- |Update the display of showing passes in a `TLTopts` record.
withShowPasses :: TLTopts -> Bool -> TLTopts
withShowPasses :: TLTopts -> Bool -> TLTopts
withShowPasses (TLTopts Bool
_ Bool
f) Bool
b = Bool -> Bool -> TLTopts
TLTopts Bool
b Bool
f

-- |Update the display of showing passes in a `TLTopts` record.
withExitAfterFail :: TLTopts -> Bool -> TLTopts
withExitAfterFail :: TLTopts -> Bool -> TLTopts
withExitAfterFail (TLTopts Bool
p Bool
_) Bool
b = Bool -> Bool -> TLTopts
TLTopts Bool
p Bool
b