make LTS branch pre-releases
[cabal.git] / Cabal-syntax / src / Distribution / Types / TestSuiteInterface.hs
blob37e87155e48fe3d2ca1955e2b5d633ca6a968d51
1 {-# LANGUAGE DataKinds #-}
2 {-# LANGUAGE DeriveDataTypeable #-}
3 {-# LANGUAGE DeriveGeneric #-}
5 module Distribution.Types.TestSuiteInterface
6 ( TestSuiteInterface (..)
7 ) where
9 import Distribution.Compat.Prelude
10 import Prelude ()
12 import Distribution.ModuleName
13 import Distribution.Types.TestType
14 import Distribution.Utils.Path
15 import Distribution.Version
17 -- | The test suite interfaces that are currently defined.
19 -- More interfaces may be defined in future, either new revisions or totally
20 -- new interfaces.
21 data TestSuiteInterface
22 = -- | Test interface \"exitcode-stdio-1.0\". The test-suite takes the form
23 -- of an executable. It returns a zero exit code for success, non-zero for
24 -- failure. The stdout and stderr channels may be logged. Test tooling may
25 -- pass command line arguments and/or connect the stdin channel to the test.
26 TestSuiteExeV10 Version (RelativePath Source File)
27 | -- | Test interface \"detailed-0.9\". The test-suite takes the form of a
28 -- library containing a designated module that exports \"tests :: [Test]\".
29 TestSuiteLibV09 Version ModuleName
30 | -- | A test suite that does not conform to one of the above interfaces for
31 -- the given reason (e.g. unknown test type).
32 TestSuiteUnsupported TestType
33 deriving (Eq, Ord, Generic, Read, Show, Typeable, Data)
35 instance Binary TestSuiteInterface
36 instance Structured TestSuiteInterface
38 instance NFData TestSuiteInterface where rnf = genericRnf
40 instance Monoid TestSuiteInterface where
41 mempty = TestSuiteUnsupported (TestTypeUnknown mempty nullVersion)
42 mappend = (<>)
44 instance Semigroup TestSuiteInterface where
45 a <> (TestSuiteUnsupported _) = a
46 _ <> b = b