Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module defines all the functions you will use to define your test suite.
Synopsis
- data TDef value = TDef {
- testDefVal :: value
- testDefCallStack :: CallStack
- type TestForest outers inner = SpecDefForest outers inner ()
- type TestTree outers inner = SpecDefTree outers inner ()
- type SpecDefForest (outers :: [Type]) inner extra = [SpecDefTree outers inner extra]
- data SpecDefTree (outers :: [Type]) inner extra where
- DefSpecifyNode :: Text -> TDef (ProgressReporter -> ((HList outers -> inner -> IO ()) -> IO ()) -> IO TestRunResult) -> extra -> SpecDefTree outers inner extra
- DefPendingNode :: Text -> Maybe Text -> SpecDefTree outers inner extra
- DefDescribeNode :: Text -> SpecDefForest outers inner extra -> SpecDefTree outers inner extra
- DefSetupNode :: IO () -> SpecDefForest outers inner extra -> SpecDefTree outers inner extra
- DefBeforeAllNode :: IO outer -> SpecDefForest (outer ': otherOuters) inner extra -> SpecDefTree otherOuters inner extra
- DefBeforeAllWithNode :: (oldOuter -> IO newOuter) -> SpecDefForest (newOuter ': (oldOuter ': otherOuters)) inner extra -> SpecDefTree (oldOuter ': otherOuters) inner extra
- DefWrapNode :: (IO () -> IO ()) -> SpecDefForest outers inner extra -> SpecDefTree outers inner extra
- DefAroundAllNode :: ((outer -> IO ()) -> IO ()) -> SpecDefForest (outer ': otherOuters) inner extra -> SpecDefTree otherOuters inner extra
- DefAroundAllWithNode :: ((newOuter -> IO ()) -> oldOuter -> IO ()) -> SpecDefForest (newOuter ': (oldOuter ': otherOuters)) inner extra -> SpecDefTree (oldOuter ': otherOuters) inner extra
- DefAfterAllNode :: (HList outers -> IO ()) -> SpecDefForest outers inner extra -> SpecDefTree outers inner extra
- DefParallelismNode :: Parallelism -> SpecDefForest outers inner extra -> SpecDefTree outers inner extra
- DefRandomisationNode :: ExecutionOrderRandomisation -> SpecDefForest outers inner extra -> SpecDefTree outers inner extra
- DefRetriesNode :: (Word -> Word) -> SpecDefForest outers inner extra -> SpecDefTree outers inner extra
- DefFlakinessNode :: FlakinessMode -> SpecDefForest outers inner extra -> SpecDefTree outers inner extra
- DefExpectationNode :: ExpectationMode -> SpecDefForest outers inner extra -> SpecDefTree outers inner extra
- filterTestForest :: [Text] -> SpecDefForest outers inner result -> SpecDefForest outers inner result
- randomiseTestForest :: MonadRandom m => SpecDefForest outers inner result -> m (SpecDefForest outers inner result)
- markSpecForestAsPending :: Maybe Text -> SpecDefForest outers inner result -> SpecDefForest outers inner result
- data Parallelism
- data ExecutionOrderRandomisation
- data FlakinessMode
- = MayNotBeFlaky
- | MayBeFlaky !(Maybe String)
- data ExpectationMode
- type ResultForest = SpecForest (TDef (Timed TestRunReport))
- type ResultTree = SpecTree (TDef (Timed TestRunReport))
- computeTestSuiteStats :: Settings -> ResultForest -> TestSuiteStats
- data TestSuiteStats = TestSuiteStats {}
- shouldExitFail :: Settings -> ResultForest -> Bool
- data TestRunReport = TestRunReport {}
- testRunReportReportedRun :: TestRunReport -> TestRunResult
- testRunReportFailed :: Settings -> TestRunReport -> Bool
- testRunReportStatus :: Settings -> TestRunReport -> TestStatus
- testStatusMatchesExpectationMode :: TestStatus -> ExpectationMode -> Bool
- testRunReportExamples :: TestRunReport -> Word
- testRunResultExamples :: TestRunResult -> Word
- testRunReportWasFlaky :: TestRunReport -> Bool
- testRunReportRetries :: TestRunReport -> Maybe Word
Documentation
TDef | |
|
Instances
Foldable TDef Source # | |
Defined in Test.Syd.SpecDef fold :: Monoid m => TDef m -> m # foldMap :: Monoid m => (a -> m) -> TDef a -> m # foldMap' :: Monoid m => (a -> m) -> TDef a -> m # foldr :: (a -> b -> b) -> b -> TDef a -> b # foldr' :: (a -> b -> b) -> b -> TDef a -> b # foldl :: (b -> a -> b) -> b -> TDef a -> b # foldl' :: (b -> a -> b) -> b -> TDef a -> b # foldr1 :: (a -> a -> a) -> TDef a -> a # foldl1 :: (a -> a -> a) -> TDef a -> a # elem :: Eq a => a -> TDef a -> Bool # maximum :: Ord a => TDef a -> a # | |
Traversable TDef Source # | |
Functor TDef Source # | |
type TestForest outers inner = SpecDefForest outers inner () Source #
type TestTree outers inner = SpecDefTree outers inner () Source #
type SpecDefForest (outers :: [Type]) inner extra = [SpecDefTree outers inner extra] Source #
data SpecDefTree (outers :: [Type]) inner extra where Source #
A tree of tests
This type has three parameters:
outers
: A type-level list of the outer resources. These are resources that are prived once, around a group of tests. (This is the type of the results ofaroundAll
.)inner
: The inner resource. This is a resource that is set up around every test, and even every example of a property test. (This is the type of the result ofaround
.)result
: The result (TestDefM
is a monad.)
In practice, all of these three parameters should be ()
at the top level.
When you're just using sydtest and not writing a library for sydtest, you probably don't even want to concern yourself with this type.
DefSpecifyNode | Define a test |
| |
DefPendingNode | Define a pending test |
| |
DefDescribeNode | Group tests using a description |
| |
DefSetupNode | |
| |
DefBeforeAllNode | |
| |
DefBeforeAllWithNode | |
| |
DefWrapNode | |
| |
DefAroundAllNode | |
| |
DefAroundAllWithNode | |
| |
DefAfterAllNode | |
| |
DefParallelismNode | Control the level of parallelism for a given group of tests |
| |
DefRandomisationNode | Control the execution order randomisation for a given group of tests |
| |
DefRetriesNode | |
| |
DefFlakinessNode | |
| |
DefExpectationNode | |
|
Instances
Foldable (SpecDefTree a c) Source # | |
Defined in Test.Syd.SpecDef fold :: Monoid m => SpecDefTree a c m -> m # foldMap :: Monoid m => (a0 -> m) -> SpecDefTree a c a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> SpecDefTree a c a0 -> m # foldr :: (a0 -> b -> b) -> b -> SpecDefTree a c a0 -> b # foldr' :: (a0 -> b -> b) -> b -> SpecDefTree a c a0 -> b # foldl :: (b -> a0 -> b) -> b -> SpecDefTree a c a0 -> b # foldl' :: (b -> a0 -> b) -> b -> SpecDefTree a c a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> SpecDefTree a c a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> SpecDefTree a c a0 -> a0 # toList :: SpecDefTree a c a0 -> [a0] # null :: SpecDefTree a c a0 -> Bool # length :: SpecDefTree a c a0 -> Int # elem :: Eq a0 => a0 -> SpecDefTree a c a0 -> Bool # maximum :: Ord a0 => SpecDefTree a c a0 -> a0 # minimum :: Ord a0 => SpecDefTree a c a0 -> a0 # sum :: Num a0 => SpecDefTree a c a0 -> a0 # product :: Num a0 => SpecDefTree a c a0 -> a0 # | |
Traversable (SpecDefTree a c) Source # | |
Defined in Test.Syd.SpecDef traverse :: Applicative f => (a0 -> f b) -> SpecDefTree a c a0 -> f (SpecDefTree a c b) # sequenceA :: Applicative f => SpecDefTree a c (f a0) -> f (SpecDefTree a c a0) # mapM :: Monad m => (a0 -> m b) -> SpecDefTree a c a0 -> m (SpecDefTree a c b) # sequence :: Monad m => SpecDefTree a c (m a0) -> m (SpecDefTree a c a0) # | |
Functor (SpecDefTree a c) Source # | |
Defined in Test.Syd.SpecDef fmap :: (a0 -> b) -> SpecDefTree a c a0 -> SpecDefTree a c b # (<$) :: a0 -> SpecDefTree a c b -> SpecDefTree a c a0 # | |
MonadWriter (TestForest outers inner) (TestDefM outers inner) Source # | |
Defined in Test.Syd.Def.TestDefM writer :: (a, TestForest outers inner) -> TestDefM outers inner a # tell :: TestForest outers inner -> TestDefM outers inner () # listen :: TestDefM outers inner a -> TestDefM outers inner (a, TestForest outers inner) # pass :: TestDefM outers inner (a, TestForest outers inner -> TestForest outers inner) -> TestDefM outers inner a # |
filterTestForest :: [Text] -> SpecDefForest outers inner result -> SpecDefForest outers inner result Source #
randomiseTestForest :: MonadRandom m => SpecDefForest outers inner result -> m (SpecDefForest outers inner result) Source #
markSpecForestAsPending :: Maybe Text -> SpecDefForest outers inner result -> SpecDefForest outers inner result Source #
data Parallelism Source #
Instances
Generic Parallelism Source # | |
Defined in Test.Syd.SpecDef type Rep Parallelism :: Type -> Type # from :: Parallelism -> Rep Parallelism x # to :: Rep Parallelism x -> Parallelism # | |
Show Parallelism Source # | |
Defined in Test.Syd.SpecDef showsPrec :: Int -> Parallelism -> ShowS # show :: Parallelism -> String # showList :: [Parallelism] -> ShowS # | |
Eq Parallelism Source # | |
Defined in Test.Syd.SpecDef (==) :: Parallelism -> Parallelism -> Bool # (/=) :: Parallelism -> Parallelism -> Bool # | |
type Rep Parallelism Source # | |
data ExecutionOrderRandomisation Source #
Instances
Generic ExecutionOrderRandomisation Source # | |
Defined in Test.Syd.SpecDef type Rep ExecutionOrderRandomisation :: Type -> Type # | |
Show ExecutionOrderRandomisation Source # | |
Defined in Test.Syd.SpecDef showsPrec :: Int -> ExecutionOrderRandomisation -> ShowS # show :: ExecutionOrderRandomisation -> String # showList :: [ExecutionOrderRandomisation] -> ShowS # | |
Eq ExecutionOrderRandomisation Source # | |
Defined in Test.Syd.SpecDef | |
type Rep ExecutionOrderRandomisation Source # | |
Defined in Test.Syd.SpecDef type Rep ExecutionOrderRandomisation = D1 ('MetaData "ExecutionOrderRandomisation" "Test.Syd.SpecDef" "sydtest-0.15.1.1-CZvd3rDS4m47TQqIsce9VY" 'False) (C1 ('MetaCons "RandomiseExecutionOrder" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DoNotRandomiseExecutionOrder" 'PrefixI 'False) (U1 :: Type -> Type)) |
data FlakinessMode Source #
Instances
Generic FlakinessMode Source # | |
Defined in Test.Syd.SpecDef type Rep FlakinessMode :: Type -> Type # from :: FlakinessMode -> Rep FlakinessMode x # to :: Rep FlakinessMode x -> FlakinessMode # | |
Show FlakinessMode Source # | |
Defined in Test.Syd.SpecDef showsPrec :: Int -> FlakinessMode -> ShowS # show :: FlakinessMode -> String # showList :: [FlakinessMode] -> ShowS # | |
Eq FlakinessMode Source # | |
Defined in Test.Syd.SpecDef (==) :: FlakinessMode -> FlakinessMode -> Bool # (/=) :: FlakinessMode -> FlakinessMode -> Bool # | |
type Rep FlakinessMode Source # | |
Defined in Test.Syd.SpecDef type Rep FlakinessMode = D1 ('MetaData "FlakinessMode" "Test.Syd.SpecDef" "sydtest-0.15.1.1-CZvd3rDS4m47TQqIsce9VY" 'False) (C1 ('MetaCons "MayNotBeFlaky" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MayBeFlaky" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe String)))) |
data ExpectationMode Source #
Instances
Generic ExpectationMode Source # | |
Defined in Test.Syd.SpecDef type Rep ExpectationMode :: Type -> Type # from :: ExpectationMode -> Rep ExpectationMode x # to :: Rep ExpectationMode x -> ExpectationMode # | |
Show ExpectationMode Source # | |
Defined in Test.Syd.SpecDef showsPrec :: Int -> ExpectationMode -> ShowS # show :: ExpectationMode -> String # showList :: [ExpectationMode] -> ShowS # | |
Eq ExpectationMode Source # | |
Defined in Test.Syd.SpecDef (==) :: ExpectationMode -> ExpectationMode -> Bool # (/=) :: ExpectationMode -> ExpectationMode -> Bool # | |
type Rep ExpectationMode Source # | |
type ResultForest = SpecForest (TDef (Timed TestRunReport)) Source #
type ResultTree = SpecTree (TDef (Timed TestRunReport)) Source #
data TestSuiteStats Source #
Instances
Monoid TestSuiteStats Source # | |
Defined in Test.Syd.SpecDef mappend :: TestSuiteStats -> TestSuiteStats -> TestSuiteStats # mconcat :: [TestSuiteStats] -> TestSuiteStats # | |
Semigroup TestSuiteStats Source # | |
Defined in Test.Syd.SpecDef (<>) :: TestSuiteStats -> TestSuiteStats -> TestSuiteStats # sconcat :: NonEmpty TestSuiteStats -> TestSuiteStats # stimes :: Integral b => b -> TestSuiteStats -> TestSuiteStats # | |
Show TestSuiteStats Source # | |
Defined in Test.Syd.SpecDef showsPrec :: Int -> TestSuiteStats -> ShowS # show :: TestSuiteStats -> String # showList :: [TestSuiteStats] -> ShowS # | |
Eq TestSuiteStats Source # | |
Defined in Test.Syd.SpecDef (==) :: TestSuiteStats -> TestSuiteStats -> Bool # (/=) :: TestSuiteStats -> TestSuiteStats -> Bool # |
shouldExitFail :: Settings -> ResultForest -> Bool Source #
data TestRunReport Source #
TestRunReport | |
|
Instances
Generic TestRunReport Source # | |
Defined in Test.Syd.SpecDef type Rep TestRunReport :: Type -> Type # from :: TestRunReport -> Rep TestRunReport x # to :: Rep TestRunReport x -> TestRunReport # | |
Show TestRunReport Source # | |
Defined in Test.Syd.SpecDef showsPrec :: Int -> TestRunReport -> ShowS # show :: TestRunReport -> String # showList :: [TestRunReport] -> ShowS # | |
type Rep TestRunReport Source # | |
Defined in Test.Syd.SpecDef type Rep TestRunReport = D1 ('MetaData "TestRunReport" "Test.Syd.SpecDef" "sydtest-0.15.1.1-CZvd3rDS4m47TQqIsce9VY" 'False) (C1 ('MetaCons "TestRunReport" 'PrefixI 'True) (S1 ('MetaSel ('Just "testRunReportExpectationMode") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ExpectationMode) :*: (S1 ('MetaSel ('Just "testRunReportRawResults") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (NonEmpty TestRunResult)) :*: S1 ('MetaSel ('Just "testRunReportFlakinessMode") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FlakinessMode)))) |
testRunReportFailed :: Settings -> TestRunReport -> Bool Source #