{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}

module Distribution.Types.TestSuiteInterface (
    TestSuiteInterface(..),
) where

import Prelude ()
import Distribution.Compat.Prelude

import Distribution.Types.TestType
import Distribution.ModuleName
import Distribution.Version

-- | The test suite interfaces that are currently defined. Each test suite must
-- specify which interface it supports.
--
-- More interfaces may be defined in future, either new revisions or totally
-- new interfaces.
--
data TestSuiteInterface =

     -- | Test interface \"exitcode-stdio-1.0\". The test-suite takes the form
     -- of an executable. It returns a zero exit code for success, non-zero for
     -- failure. The stdout and stderr channels may be logged. It takes no
     -- command line parameters and nothing on stdin.
     --
     TestSuiteExeV10 Version FilePath

     -- | Test interface \"detailed-0.9\". The test-suite takes the form of a
     -- library containing a designated module that exports \"tests :: [Test]\".
     --
   | TestSuiteLibV09 Version ModuleName

     -- | A test suite that does not conform to one of the above interfaces for
     -- the given reason (e.g. unknown test type).
     --
   | TestSuiteUnsupported TestType
   deriving (TestSuiteInterface -> TestSuiteInterface -> Bool
(TestSuiteInterface -> TestSuiteInterface -> Bool)
-> (TestSuiteInterface -> TestSuiteInterface -> Bool)
-> Eq TestSuiteInterface
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TestSuiteInterface -> TestSuiteInterface -> Bool
$c/= :: TestSuiteInterface -> TestSuiteInterface -> Bool
== :: TestSuiteInterface -> TestSuiteInterface -> Bool
$c== :: TestSuiteInterface -> TestSuiteInterface -> Bool
External instance of the constraint type Eq Char
External instance of the constraint type Eq TestType
External instance of the constraint type Eq ModuleName
External instance of the constraint type Eq Char
External instance of the constraint type forall a. Eq a => Eq [a]
External instance of the constraint type Eq Version
External instance of the constraint type Eq Version
Eq, (forall x. TestSuiteInterface -> Rep TestSuiteInterface x)
-> (forall x. Rep TestSuiteInterface x -> TestSuiteInterface)
-> Generic TestSuiteInterface
forall x. Rep TestSuiteInterface x -> TestSuiteInterface
forall x. TestSuiteInterface -> Rep TestSuiteInterface x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TestSuiteInterface x -> TestSuiteInterface
$cfrom :: forall x. TestSuiteInterface -> Rep TestSuiteInterface x
Generic, ReadPrec [TestSuiteInterface]
ReadPrec TestSuiteInterface
Int -> ReadS TestSuiteInterface
ReadS [TestSuiteInterface]
(Int -> ReadS TestSuiteInterface)
-> ReadS [TestSuiteInterface]
-> ReadPrec TestSuiteInterface
-> ReadPrec [TestSuiteInterface]
-> Read TestSuiteInterface
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TestSuiteInterface]
$creadListPrec :: ReadPrec [TestSuiteInterface]
readPrec :: ReadPrec TestSuiteInterface
$creadPrec :: ReadPrec TestSuiteInterface
readList :: ReadS [TestSuiteInterface]
$creadList :: ReadS [TestSuiteInterface]
readsPrec :: Int -> ReadS TestSuiteInterface
$creadsPrec :: Int -> ReadS TestSuiteInterface
External instance of the constraint type Read Char
External instance of the constraint type Read TestType
External instance of the constraint type Read ModuleName
External instance of the constraint type Read Char
External instance of the constraint type forall a. Read a => Read [a]
External instance of the constraint type Read Version
External instance of the constraint type Read Version
External instance of the constraint type Monad ReadPrec
External instance of the constraint type Monad ReadPrec
Instance of class: Read of the constraint type Read TestSuiteInterface
Read, Int -> TestSuiteInterface -> ShowS
[TestSuiteInterface] -> ShowS
TestSuiteInterface -> FilePath
(Int -> TestSuiteInterface -> ShowS)
-> (TestSuiteInterface -> FilePath)
-> ([TestSuiteInterface] -> ShowS)
-> Show TestSuiteInterface
forall a.
(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
showList :: [TestSuiteInterface] -> ShowS
$cshowList :: [TestSuiteInterface] -> ShowS
show :: TestSuiteInterface -> FilePath
$cshow :: TestSuiteInterface -> FilePath
showsPrec :: Int -> TestSuiteInterface -> ShowS
$cshowsPrec :: Int -> TestSuiteInterface -> ShowS
External instance of the constraint type Show Char
External instance of the constraint type Show TestType
External instance of the constraint type Show ModuleName
External instance of the constraint type Show Char
External instance of the constraint type forall a. Show a => Show [a]
External instance of the constraint type Show Version
External instance of the constraint type Show Version
External instance of the constraint type Ord Int
External instance of the constraint type Ord Int
Show, Typeable, Typeable TestSuiteInterface
DataType
Constr
Typeable TestSuiteInterface
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g)
    -> TestSuiteInterface
    -> c TestSuiteInterface)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c TestSuiteInterface)
-> (TestSuiteInterface -> Constr)
-> (TestSuiteInterface -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c TestSuiteInterface))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c TestSuiteInterface))
-> ((forall b. Data b => b -> b)
    -> TestSuiteInterface -> TestSuiteInterface)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> TestSuiteInterface -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> TestSuiteInterface -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> TestSuiteInterface -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> TestSuiteInterface -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> TestSuiteInterface -> m TestSuiteInterface)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> TestSuiteInterface -> m TestSuiteInterface)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> TestSuiteInterface -> m TestSuiteInterface)
-> Data TestSuiteInterface
TestSuiteInterface -> DataType
TestSuiteInterface -> Constr
(forall b. Data b => b -> b)
-> TestSuiteInterface -> TestSuiteInterface
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> TestSuiteInterface
-> c TestSuiteInterface
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TestSuiteInterface
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> TestSuiteInterface -> u
forall u. (forall d. Data d => d -> u) -> TestSuiteInterface -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TestSuiteInterface -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TestSuiteInterface -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> TestSuiteInterface -> m TestSuiteInterface
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> TestSuiteInterface -> m TestSuiteInterface
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TestSuiteInterface
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> TestSuiteInterface
-> c TestSuiteInterface
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TestSuiteInterface)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c TestSuiteInterface)
$cTestSuiteUnsupported :: Constr
$cTestSuiteLibV09 :: Constr
$cTestSuiteExeV10 :: Constr
$tTestSuiteInterface :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> TestSuiteInterface -> m TestSuiteInterface
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> TestSuiteInterface -> m TestSuiteInterface
gmapMp :: (forall d. Data d => d -> m d)
-> TestSuiteInterface -> m TestSuiteInterface
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> TestSuiteInterface -> m TestSuiteInterface
gmapM :: (forall d. Data d => d -> m d)
-> TestSuiteInterface -> m TestSuiteInterface
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> TestSuiteInterface -> m TestSuiteInterface
gmapQi :: Int -> (forall d. Data d => d -> u) -> TestSuiteInterface -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> TestSuiteInterface -> u
gmapQ :: (forall d. Data d => d -> u) -> TestSuiteInterface -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> TestSuiteInterface -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TestSuiteInterface -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TestSuiteInterface -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TestSuiteInterface -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TestSuiteInterface -> r
gmapT :: (forall b. Data b => b -> b)
-> TestSuiteInterface -> TestSuiteInterface
$cgmapT :: (forall b. Data b => b -> b)
-> TestSuiteInterface -> TestSuiteInterface
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c TestSuiteInterface)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c TestSuiteInterface)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c TestSuiteInterface)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TestSuiteInterface)
dataTypeOf :: TestSuiteInterface -> DataType
$cdataTypeOf :: TestSuiteInterface -> DataType
toConstr :: TestSuiteInterface -> Constr
$ctoConstr :: TestSuiteInterface -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TestSuiteInterface
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TestSuiteInterface
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> TestSuiteInterface
-> c TestSuiteInterface
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> TestSuiteInterface
-> c TestSuiteInterface
External instance of the constraint type Data Char
External instance of the constraint type Data Version
External instance of the constraint type Data Char
External instance of the constraint type Data TestType
External instance of the constraint type Data ModuleName
External instance of the constraint type Data Version
External instance of the constraint type Data Version
External instance of the constraint type Data Char
External instance of the constraint type forall a. Data a => Data [a]
Data)

instance Binary TestSuiteInterface
instance Structured TestSuiteInterface

instance NFData TestSuiteInterface where rnf :: TestSuiteInterface -> ()
rnf = TestSuiteInterface -> ()
forall a. (Generic a, GNFData (Rep a)) => a -> ()
External instance of the constraint type forall (a :: * -> *) i (c :: Meta). GNFData a => GNFData (M1 i c a)
External instance of the constraint type forall (a :: * -> *) (b :: * -> *).
(GNFData a, GNFData b) =>
GNFData (a :+: b)
External instance of the constraint type forall (a :: * -> *) i (c :: Meta). GNFData a => GNFData (M1 i c a)
External instance of the constraint type forall (a :: * -> *) (b :: * -> *).
(GNFData a, GNFData b) =>
GNFData (a :*: b)
External instance of the constraint type forall (a :: * -> *) i (c :: Meta). GNFData a => GNFData (M1 i c a)
External instance of the constraint type forall a i. NFData a => GNFData (K1 i a)
External instance of the constraint type NFData Version
External instance of the constraint type forall (a :: * -> *) i (c :: Meta). GNFData a => GNFData (M1 i c a)
External instance of the constraint type forall a i. NFData a => GNFData (K1 i a)
External instance of the constraint type forall a. NFData a => NFData [a]
External instance of the constraint type NFData Char
External instance of the constraint type forall (a :: * -> *) (b :: * -> *).
(GNFData a, GNFData b) =>
GNFData (a :+: b)
External instance of the constraint type forall (a :: * -> *) i (c :: Meta). GNFData a => GNFData (M1 i c a)
External instance of the constraint type forall (a :: * -> *) (b :: * -> *).
(GNFData a, GNFData b) =>
GNFData (a :*: b)
External instance of the constraint type forall (a :: * -> *) i (c :: Meta). GNFData a => GNFData (M1 i c a)
External instance of the constraint type forall a i. NFData a => GNFData (K1 i a)
External instance of the constraint type NFData Version
External instance of the constraint type forall (a :: * -> *) i (c :: Meta). GNFData a => GNFData (M1 i c a)
External instance of the constraint type forall a i. NFData a => GNFData (K1 i a)
External instance of the constraint type NFData ModuleName
External instance of the constraint type forall (a :: * -> *) i (c :: Meta). GNFData a => GNFData (M1 i c a)
External instance of the constraint type forall (a :: * -> *) i (c :: Meta). GNFData a => GNFData (M1 i c a)
External instance of the constraint type forall a i. NFData a => GNFData (K1 i a)
External instance of the constraint type NFData TestType
Instance of class: Generic of the constraint type Generic TestSuiteInterface
genericRnf

instance Monoid TestSuiteInterface where
    mempty :: TestSuiteInterface
mempty  =  TestType -> TestSuiteInterface
TestSuiteUnsupported (FilePath -> Version -> TestType
TestTypeUnknown FilePath
forall a. Monoid a => a
External instance of the constraint type forall a. Monoid [a]
mempty Version
nullVersion)
    mappend :: TestSuiteInterface -> TestSuiteInterface -> TestSuiteInterface
mappend = TestSuiteInterface -> TestSuiteInterface -> TestSuiteInterface
forall a. Semigroup a => a -> a -> a
Instance of class: Semigroup of the constraint type Semigroup TestSuiteInterface
(<>)

instance Semigroup TestSuiteInterface where
    TestSuiteInterface
a <> :: TestSuiteInterface -> TestSuiteInterface -> TestSuiteInterface
<> (TestSuiteUnsupported TestType
_) = TestSuiteInterface
a
    TestSuiteInterface
_ <> TestSuiteInterface
b                        = TestSuiteInterface
b