Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class Monad m => TestRunner m where
- type ApplyPatchReqs m (p :: * -> * -> *) :: Constraint
- type DisplayPatchReqs m (p :: * -> * -> *) :: Constraint
- writeMsg :: String -> m wX wX ()
- mentionPatch :: DisplayPatchReqs m p => p wA wB -> m wX wX ()
- applyPatch :: ApplyPatchReqs m p => p wX wY -> m wX wY ()
- unapplyPatch :: ApplyPatchReqs m p => p wX wY -> m wY wX ()
- getCurrentTestResult :: m wX wX (TestResult wX)
- finishedTesting :: a -> m wX TestingDone a
- runStrategy :: TestablePatch m p => TestStrategy -> ShrinkFailure -> RL p wOlder wNewer -> m wNewer TestingDone (StrategyResultSealed p)
- data TestResult wX
- = Testable (TestResultValid wX)
- | Untestable
- data TestResultValid wX
- = Success
- | Failure (TestFailure wX)
- data TestFailure wX = TestFailure Int
- data TestingDone
- data PatchSeq p wX wY where
- patchTreeToFL :: PatchSeq p wX wY -> FL p wX wY
- type StrategyResult p wSuccess wFailure = StrategyResultRaw (PatchSeq p wSuccess wFailure)
- data StrategyResultRaw patches
- = NoPasses
- | NoFailureOnHead
- | Blame patches
- | RunSuccess
- | RunFailed Int
- explanatoryTextFor :: TestStrategy -> String
- runTestingEnv :: TestingParams -> TestingEnv m wA TestingDone a -> m a
- exitCodeToTestResult :: ExitCode -> TestResult wX
- mkTestCmd :: (forall (wX :: *). IO (TestResult wX)) -> TestCmd
- runTestable :: (Commute p, TestRunner (TestingEnv m), TestRunnerPatchReqs (TestingEnv m) p) => SetScriptsExecutable -> TestCmd -> TestStrategy -> ShrinkFailure -> RL p wStart wA -> m (StrategyResultSealed p)
Documentation
class Monad m => TestRunner m where Source #
An indexed monad that can be used to run tests. TestingEnvIO
is
the only real implementation, the unit tests for testing are based on
mock implementations.
type ApplyPatchReqs m (p :: * -> * -> *) :: Constraint Source #
type DisplayPatchReqs m (p :: * -> * -> *) :: Constraint Source #
writeMsg :: String -> m wX wX () Source #
Output a message
mentionPatch :: DisplayPatchReqs m p => p wA wB -> m wX wX () Source #
Output a message containing the name of a patch
applyPatch :: ApplyPatchReqs m p => p wX wY -> m wX wY () Source #
Apply a patch to the testing tree.
unapplyPatch :: ApplyPatchReqs m p => p wX wY -> m wY wX () Source #
Unapply a patch from the testing tree
getCurrentTestResult :: m wX wX (TestResult wX) Source #
Get the current status (passskipfail) of the testing tree, e.g. by running the test command.
finishedTesting :: a -> m wX TestingDone a Source #
Flag that all testing has completed.
runStrategy :: TestablePatch m p => TestStrategy -> ShrinkFailure -> RL p wOlder wNewer -> m wNewer TestingDone (StrategyResultSealed p) Source #
data TestResult wX Source #
The result of running a test on state wX
of the repository.
Testable (TestResultValid wX) | We got a usable test result. |
Untestable | The test result could not be identified as either pass or fail, for example it might have been a build failure. External test scripts report this by reporting exit code 125. |
data TestResultValid wX Source #
A usable test result, i.e. not an untestable state.
Success | The test passed. |
Failure (TestFailure wX) | The test failed with the given exit code. |
data TestFailure wX Source #
data TestingDone Source #
Once we've finished tracking down a test failure, we no longer care about tracking the actual state of the testing tree. This witness constant is never used in any patch, so once we use it for the state of the testing tree, in practice we can no longer do anything more with that tree.
We could also use some kind of existential or different monad type to represent this, but it would make composing code with 'do' harder.
data PatchSeq p wX wY where Source #
PatchSeq
is a sequence of patches, implemented as a binary tree,
balanced in an arbitrary way depending on how it happened to be constructed.
In the 'darcs test' implementation it is used to
wrap up a single patch or group of patches that might be the cause of a failure.
Single :: p wX wY -> PatchSeq p wX wY | |
Joined :: PatchSeq p wX wY -> PatchSeq p wY wZ -> PatchSeq p wX wZ |
Instances
Apply p => Apply (PatchSeq p) Source # | |
Defined in Darcs.UI.Commands.Test.Impl apply :: ApplyMonad (ApplyState (PatchSeq p)) m => PatchSeq p wX wY -> m () Source # unapply :: ApplyMonad (ApplyState (PatchSeq p)) m => PatchSeq p wX wY -> m () Source # | |
PatchInspect p => PatchInspect (PatchSeq p) Source # | |
Defined in Darcs.UI.Commands.Test.Impl listTouchedFiles :: PatchSeq p wX wY -> [AnchoredPath] Source # hunkMatches :: (ByteString -> Bool) -> PatchSeq p wX wY -> Bool Source # | |
Show2 p => Show2 (PatchSeq p) Source # | |
Defined in Darcs.UI.Commands.Test.Impl | |
Show2 p => Show1 (PatchSeq p wX) Source # | |
Show2 p => Show (PatchSeq p wX wY) Source # | |
type ApplyState (PatchSeq p) Source # | |
Defined in Darcs.UI.Commands.Test.Impl |
patchTreeToFL :: PatchSeq p wX wY -> FL p wX wY Source #
type StrategyResult p wSuccess wFailure = StrategyResultRaw (PatchSeq p wSuccess wFailure) Source #
data StrategyResultRaw patches Source #
The result of running a test strategy.
NoPasses | The chosen strategy didn't find any passing states in the repository. |
NoFailureOnHead | The test didn't fail on head so there's no failure to track down. |
Blame patches | The failure was tracked down to the given patches. these two are just for oneTest |
RunSuccess | The single test run passed. |
RunFailed Int | The single test run failed with the given exit code. |
Instances
Functor StrategyResultRaw Source # | |
Defined in Darcs.UI.Commands.Test.Impl fmap :: (a -> b) -> StrategyResultRaw a -> StrategyResultRaw b # (<$) :: a -> StrategyResultRaw b -> StrategyResultRaw a # | |
Show patches => Show (StrategyResultRaw patches) Source # | |
Defined in Darcs.UI.Commands.Test.Impl showsPrec :: Int -> StrategyResultRaw patches -> ShowS # show :: StrategyResultRaw patches -> String # showList :: [StrategyResultRaw patches] -> ShowS # | |
Eq patches => Eq (StrategyResultRaw patches) Source # | |
Defined in Darcs.UI.Commands.Test.Impl (==) :: StrategyResultRaw patches -> StrategyResultRaw patches -> Bool # (/=) :: StrategyResultRaw patches -> StrategyResultRaw patches -> Bool # |
runTestingEnv :: TestingParams -> TestingEnv m wA TestingDone a -> m a Source #
exitCodeToTestResult :: ExitCode -> TestResult wX Source #
mkTestCmd :: (forall (wX :: *). IO (TestResult wX)) -> TestCmd Source #
runTestable :: (Commute p, TestRunner (TestingEnv m), TestRunnerPatchReqs (TestingEnv m) p) => SetScriptsExecutable -> TestCmd -> TestStrategy -> ShrinkFailure -> RL p wStart wA -> m (StrategyResultSealed p) Source #