2015-07-13 17:19:20 +00:00
|
|
|
{- git-annex test data types.
|
|
|
|
-
|
2017-03-17 23:13:52 +00:00
|
|
|
- Copyright 2011-2017 Joey Hess <id@joeyh.name>
|
2015-07-13 17:19:20 +00:00
|
|
|
-
|
|
|
|
- Licensed under the GNU GPL version 3 or higher.
|
|
|
|
-}
|
|
|
|
|
|
|
|
module Types.Test where
|
|
|
|
|
|
|
|
import Test.Tasty.Options
|
2016-01-13 16:18:20 +00:00
|
|
|
import Data.Monoid
|
|
|
|
import Prelude
|
2017-03-17 23:13:52 +00:00
|
|
|
import Types.Command
|
2015-07-13 17:19:20 +00:00
|
|
|
|
2016-01-06 17:44:12 +00:00
|
|
|
data TestOptions = TestOptions
|
|
|
|
{ tastyOptionSet :: OptionSet
|
|
|
|
, keepFailuresOption :: Bool
|
2017-03-17 23:13:52 +00:00
|
|
|
, fakeSsh :: Bool
|
|
|
|
, internalData :: CmdParams
|
2016-01-06 17:44:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
instance Monoid TestOptions where
|
2017-03-17 23:13:52 +00:00
|
|
|
mempty = TestOptions mempty False False mempty
|
2016-01-13 16:18:20 +00:00
|
|
|
mappend a b = TestOptions
|
|
|
|
(tastyOptionSet a <> tastyOptionSet b)
|
|
|
|
(keepFailuresOption a || keepFailuresOption b)
|
2017-03-17 23:13:52 +00:00
|
|
|
(fakeSsh a || fakeSsh b)
|
|
|
|
(internalData a <> internalData b)
|
2016-01-06 17:44:12 +00:00
|
|
|
|
2015-07-13 17:19:20 +00:00
|
|
|
|
|
|
|
type TestRunner = TestOptions -> IO ()
|