{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
module Distribution.Types.TestSuite (
TestSuite(..),
emptyTestSuite,
testType,
testModules,
testModulesAutogen
) where
import Prelude ()
import Distribution.Compat.Prelude
import Distribution.Types.BuildInfo
import Distribution.Types.TestType
import Distribution.Types.TestSuiteInterface
import Distribution.Types.UnqualComponentName
import Distribution.ModuleName
import qualified Distribution.Types.BuildInfo.Lens as L
data TestSuite = TestSuite {
TestSuite -> UnqualComponentName
testName :: UnqualComponentName,
TestSuite -> TestSuiteInterface
testInterface :: TestSuiteInterface,
TestSuite -> BuildInfo
testBuildInfo :: BuildInfo
}
deriving ((forall x. TestSuite -> Rep TestSuite x)
-> (forall x. Rep TestSuite x -> TestSuite) -> Generic TestSuite
forall x. Rep TestSuite x -> TestSuite
forall x. TestSuite -> Rep TestSuite x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TestSuite x -> TestSuite
$cfrom :: forall x. TestSuite -> Rep TestSuite x
Generic, Int -> TestSuite -> ShowS
[TestSuite] -> ShowS
TestSuite -> String
(Int -> TestSuite -> ShowS)
-> (TestSuite -> String)
-> ([TestSuite] -> ShowS)
-> Show TestSuite
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TestSuite] -> ShowS
$cshowList :: [TestSuite] -> ShowS
show :: TestSuite -> String
$cshow :: TestSuite -> String
showsPrec :: Int -> TestSuite -> ShowS
$cshowsPrec :: Int -> TestSuite -> ShowS
External instance of the constraint type Show BuildInfo
External instance of the constraint type Show TestSuiteInterface
External instance of the constraint type Show UnqualComponentName
External instance of the constraint type Ord Int
Show, ReadPrec [TestSuite]
ReadPrec TestSuite
Int -> ReadS TestSuite
ReadS [TestSuite]
(Int -> ReadS TestSuite)
-> ReadS [TestSuite]
-> ReadPrec TestSuite
-> ReadPrec [TestSuite]
-> Read TestSuite
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TestSuite]
$creadListPrec :: ReadPrec [TestSuite]
readPrec :: ReadPrec TestSuite
$creadPrec :: ReadPrec TestSuite
readList :: ReadS [TestSuite]
$creadList :: ReadS [TestSuite]
readsPrec :: Int -> ReadS TestSuite
$creadsPrec :: Int -> ReadS TestSuite
External instance of the constraint type Read BuildInfo
External instance of the constraint type Read TestSuiteInterface
External instance of the constraint type Read UnqualComponentName
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 TestSuite
Read, TestSuite -> TestSuite -> Bool
(TestSuite -> TestSuite -> Bool)
-> (TestSuite -> TestSuite -> Bool) -> Eq TestSuite
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TestSuite -> TestSuite -> Bool
$c/= :: TestSuite -> TestSuite -> Bool
== :: TestSuite -> TestSuite -> Bool
$c== :: TestSuite -> TestSuite -> Bool
External instance of the constraint type Eq BuildInfo
External instance of the constraint type Eq TestSuiteInterface
External instance of the constraint type Eq UnqualComponentName
Eq, Typeable, Typeable TestSuite
DataType
Constr
Typeable TestSuite
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TestSuite -> c TestSuite)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TestSuite)
-> (TestSuite -> Constr)
-> (TestSuite -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TestSuite))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TestSuite))
-> ((forall b. Data b => b -> b) -> TestSuite -> TestSuite)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TestSuite -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TestSuite -> r)
-> (forall u. (forall d. Data d => d -> u) -> TestSuite -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> TestSuite -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TestSuite -> m TestSuite)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TestSuite -> m TestSuite)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TestSuite -> m TestSuite)
-> Data TestSuite
TestSuite -> DataType
TestSuite -> Constr
(forall b. Data b => b -> b) -> TestSuite -> TestSuite
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TestSuite -> c TestSuite
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TestSuite
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) -> TestSuite -> u
forall u. (forall d. Data d => d -> u) -> TestSuite -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TestSuite -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TestSuite -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TestSuite -> m TestSuite
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TestSuite -> m TestSuite
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TestSuite
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TestSuite -> c TestSuite
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TestSuite)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TestSuite)
$cTestSuite :: Constr
$tTestSuite :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> TestSuite -> m TestSuite
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TestSuite -> m TestSuite
gmapMp :: (forall d. Data d => d -> m d) -> TestSuite -> m TestSuite
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TestSuite -> m TestSuite
gmapM :: (forall d. Data d => d -> m d) -> TestSuite -> m TestSuite
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TestSuite -> m TestSuite
gmapQi :: Int -> (forall d. Data d => d -> u) -> TestSuite -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> TestSuite -> u
gmapQ :: (forall d. Data d => d -> u) -> TestSuite -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> TestSuite -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TestSuite -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TestSuite -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TestSuite -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TestSuite -> r
gmapT :: (forall b. Data b => b -> b) -> TestSuite -> TestSuite
$cgmapT :: (forall b. Data b => b -> b) -> TestSuite -> TestSuite
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TestSuite)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TestSuite)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c TestSuite)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TestSuite)
dataTypeOf :: TestSuite -> DataType
$cdataTypeOf :: TestSuite -> DataType
toConstr :: TestSuite -> Constr
$ctoConstr :: TestSuite -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TestSuite
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TestSuite
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TestSuite -> c TestSuite
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TestSuite -> c TestSuite
External instance of the constraint type Data UnqualComponentName
External instance of the constraint type Data TestSuiteInterface
External instance of the constraint type Data BuildInfo
Data)
instance L.HasBuildInfo TestSuite where
buildInfo :: LensLike f TestSuite TestSuite BuildInfo BuildInfo
buildInfo BuildInfo -> f BuildInfo
f TestSuite
l = (\BuildInfo
x -> TestSuite
l { testBuildInfo :: BuildInfo
testBuildInfo = BuildInfo
x }) (BuildInfo -> TestSuite) -> f BuildInfo -> f TestSuite
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Evidence bound by a type signature of the constraint type Functor f
<$> BuildInfo -> f BuildInfo
f (TestSuite -> BuildInfo
testBuildInfo TestSuite
l)
instance Binary TestSuite
instance Structured TestSuite
instance NFData TestSuite where rnf :: TestSuite -> ()
rnf = TestSuite -> ()
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 :: * -> *) 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 UnqualComponentName
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 TestSuiteInterface
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 BuildInfo
Instance of class: Generic of the constraint type Generic TestSuite
genericRnf
instance Monoid TestSuite where
mempty :: TestSuite
mempty = TestSuite :: UnqualComponentName -> TestSuiteInterface -> BuildInfo -> TestSuite
TestSuite {
testName :: UnqualComponentName
testName = UnqualComponentName
forall a. Monoid a => a
External instance of the constraint type Monoid UnqualComponentName
mempty,
testInterface :: TestSuiteInterface
testInterface = TestSuiteInterface
forall a. Monoid a => a
External instance of the constraint type Monoid TestSuiteInterface
mempty,
testBuildInfo :: BuildInfo
testBuildInfo = BuildInfo
forall a. Monoid a => a
External instance of the constraint type Monoid BuildInfo
mempty
}
mappend :: TestSuite -> TestSuite -> TestSuite
mappend = TestSuite -> TestSuite -> TestSuite
forall a. Semigroup a => a -> a -> a
Instance of class: Semigroup of the constraint type Semigroup TestSuite
(<>)
instance Semigroup TestSuite where
TestSuite
a <> :: TestSuite -> TestSuite -> TestSuite
<> TestSuite
b = TestSuite :: UnqualComponentName -> TestSuiteInterface -> BuildInfo -> TestSuite
TestSuite {
testName :: UnqualComponentName
testName = (TestSuite -> UnqualComponentName) -> UnqualComponentName
combine' TestSuite -> UnqualComponentName
testName,
testInterface :: TestSuiteInterface
testInterface = (TestSuite -> TestSuiteInterface) -> TestSuiteInterface
forall {a}. Monoid a => (TestSuite -> a) -> a
External instance of the constraint type Monoid TestSuiteInterface
combine TestSuite -> TestSuiteInterface
testInterface,
testBuildInfo :: BuildInfo
testBuildInfo = (TestSuite -> BuildInfo) -> BuildInfo
forall {a}. Monoid a => (TestSuite -> a) -> a
External instance of the constraint type Monoid BuildInfo
combine TestSuite -> BuildInfo
testBuildInfo
}
where combine :: (TestSuite -> a) -> a
combine TestSuite -> a
field = TestSuite -> a
field TestSuite
a a -> a -> a
forall a. Monoid a => a -> a -> a
Evidence bound by a type signature of the constraint type Monoid a
`mappend` TestSuite -> a
field TestSuite
b
combine' :: (TestSuite -> UnqualComponentName) -> UnqualComponentName
combine' TestSuite -> UnqualComponentName
field = case ( UnqualComponentName -> String
unUnqualComponentName (UnqualComponentName -> String) -> UnqualComponentName -> String
forall a b. (a -> b) -> a -> b
$ TestSuite -> UnqualComponentName
field TestSuite
a
, UnqualComponentName -> String
unUnqualComponentName (UnqualComponentName -> String) -> UnqualComponentName -> String
forall a b. (a -> b) -> a -> b
$ TestSuite -> UnqualComponentName
field TestSuite
b) of
(String
"", String
_) -> TestSuite -> UnqualComponentName
field TestSuite
b
(String
_, String
"") -> TestSuite -> UnqualComponentName
field TestSuite
a
(String
x, String
y) -> String -> UnqualComponentName
forall a. HasCallStack => String -> a
error (String -> UnqualComponentName) -> String -> UnqualComponentName
forall a b. (a -> b) -> a -> b
$ String
"Ambiguous values for test field: '"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
x String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
"' and '" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
y String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
"'"
emptyTestSuite :: TestSuite
emptyTestSuite :: TestSuite
emptyTestSuite = TestSuite
forall a. Monoid a => a
Instance of class: Monoid of the constraint type Monoid TestSuite
mempty
testType :: TestSuite -> TestType
testType :: TestSuite -> TestType
testType TestSuite
test = case TestSuite -> TestSuiteInterface
testInterface TestSuite
test of
TestSuiteExeV10 Version
ver String
_ -> Version -> TestType
TestTypeExe Version
ver
TestSuiteLibV09 Version
ver ModuleName
_ -> Version -> TestType
TestTypeLib Version
ver
TestSuiteUnsupported TestType
testtype -> TestType
testtype
testModules :: TestSuite -> [ModuleName]
testModules :: TestSuite -> [ModuleName]
testModules TestSuite
test = (case TestSuite -> TestSuiteInterface
testInterface TestSuite
test of
TestSuiteLibV09 Version
_ ModuleName
m -> [ModuleName
m]
TestSuiteInterface
_ -> [])
[ModuleName] -> [ModuleName] -> [ModuleName]
forall a. [a] -> [a] -> [a]
++ BuildInfo -> [ModuleName]
otherModules (TestSuite -> BuildInfo
testBuildInfo TestSuite
test)
testModulesAutogen :: TestSuite -> [ModuleName]
testModulesAutogen :: TestSuite -> [ModuleName]
testModulesAutogen TestSuite
test = BuildInfo -> [ModuleName]
autogenModules (TestSuite -> BuildInfo
testBuildInfo TestSuite
test)