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.
|
|
|
|
-}
|
|
|
|
|
|
|
|
{-# LANGUAGE CPP #-}
|
|
|
|
|
|
|
|
module Types.Test where
|
|
|
|
|
|
|
|
#ifdef WITH_TESTSUITE
|
|
|
|
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
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef WITH_TESTSUITE
|
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
|
|
|
#else
|
|
|
|
type TestOptions = ()
|
|
|
|
#endif
|
|
|
|
|
|
|
|
type TestRunner = TestOptions -> IO ()
|