-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Framework for running and organising tests, with HUnit and QuickCheck support -- -- Allows tests such as QuickCheck properties and HUnit test cases to be -- assembled into test groups, run in parallel (but reported in -- deterministic order, to aid diff interpretation) and filtered and -- controlled by command line options. All of this comes with colored -- test output, progress reporting and test statistics output. @package test-framework @version 0.2.2 module Test.Framework.Seed data Seed FixedSeed :: Int -> Seed RandomSeed :: Seed -- | Given a Seed, returns a new random number generator based on -- that seed and the actual numeric seed that was used to build that -- generator, so it can be recreated. newSeededStdGen :: Seed -> IO (StdGen, Int) newStdGenWithKnownSeed :: IO (StdGen, Int) instance Read Seed instance Show Seed module Test.Framework.Options type TestOptions = TestOptions' Maybe type CompleteTestOptions = TestOptions' K data TestOptions' f TestOptions :: f Seed -> f Int -> f Int -> f (Maybe Int) -> TestOptions' f -- | Seed that should be used to create random numbers for generated tests topt_seed :: TestOptions' f -> f Seed -- | Maximum number of tests to generate when using something like -- QuickCheck topt_maximum_generated_tests :: TestOptions' f -> f Int -- | Maximum number of unsuitable tests to consider before giving up when -- using something like QuickCheck topt_maximum_unsuitable_generated_tests :: TestOptions' f -> f Int -- | The number of microseconds to run tests for before considering them a -- failure topt_timeout :: TestOptions' f -> f (Maybe Int) instance Monoid (TestOptions' Maybe) module Test.Framework.Runners.Options type RunnerOptions = RunnerOptions' Maybe type CompleteRunnerOptions = RunnerOptions' K data RunnerOptions' f RunnerOptions :: f Int -> f TestOptions -> f [TestPattern] -> RunnerOptions' f ropt_threads :: RunnerOptions' f -> f Int ropt_test_options :: RunnerOptions' f -> f TestOptions ropt_test_patterns :: RunnerOptions' f -> f [TestPattern] instance Monoid (RunnerOptions' Maybe) -- | This module exports everything that you need to be able to create your -- own framework test provider. To create a provider you need to: -- -- module Test.Framework.Providers.API -- | Something like the result of a test: works in concert with -- Testlike. The type parameters are the type that is used for -- progress reports and the type of the final output of the test -- respectively. class (Show i, Show r) => TestResultlike i r | r -> i testSucceeded :: (TestResultlike i r) => r -> Bool -- | Something test-like in its behaviour. The type parameters are the type -- that is used for progress reports, the type of the final output of the -- test and the data type encapsulating the whole potential to do a test -- respectively. class (TestResultlike i r) => Testlike i r t | t -> i r, r -> i runTest :: (Testlike i r t) => CompleteTestOptions -> t -> IO (i :~> r, IO ()) testTypeName :: (Testlike i r t) => t -> TestTypeName -- | Test names or descriptions. These are shown to the user type TestName = String -- | The name of a type of test, such as Properties or Test -- Cases. Tests of types of the same names will be grouped together -- in the test run summary. type TestTypeName = String -- | Main test data type: builds up a list of tests to be run. Users should -- use the utility functions in e.g. the test-framework-hunit and -- test-framework-quickcheck packages to create instances of Test, -- and then build them up into testsuites by using testGroup and -- lists. -- -- For an example of how to use test-framework, please see -- http://github.com/batterseapower/test-framework/raw/master/example/Test/Framework/Example.lhs data Test -- | A single test of some particular type. Test :: TestName -> t -> Test TestGroup :: TestName -> [Test] -> Test PlusTestOptions :: TestOptions -> Test -> Test -- | Assemble a number of tests into a cohesive group testGroup :: TestName -> [Test] -> Test plusTestOptions :: TestOptions -> Test -> Test data (:~>) i f Finished :: f -> :~> i f Improving :: i -> (i :~> f) -> :~> i f data ImprovingIO i f a yieldImprovement :: i -> ImprovingIO i f () runImprovingIO :: ImprovingIO i f f -> IO (i :~> f, IO ()) liftIO :: IO a -> ImprovingIO i f a -- | Given a number of microseconds and an improving IO action, run that -- improving IO action only for at most the given period before giving -- up. See also timeout. timeoutImprovingIO :: Int -> ImprovingIO i f a -> ImprovingIO i f (Maybe a) -- | As timeoutImprovingIO, but don't bother applying a timeout to -- the action if Nothing is given as the number of microseconds -- to apply the time out for. maybeTimeoutImprovingIO :: Maybe Int -> ImprovingIO i f a -> ImprovingIO i f (Maybe a) newtype K a K :: a -> K a unK :: K a -> a secondsToMicroseconds :: (Num a) => a -> a microsecondsToPicoseconds :: (Num a) => a -> a listToMaybeLast :: [a] -> Maybe a mappendBy :: (Monoid b) => (a -> b) -> a -> a -> b orElse :: Maybe a -> a -> a onLeft :: (a -> c) -> (a, b) -> (c, b) onRight :: (b -> c) -> (a, b) -> (a, c) -- | Like unlines, but does not append a trailing newline if there -- is at least one line. For example: -- --
--   unlinesConcise ["A", "B"] == "A\nB"
--   unlinesConcise [] == ""
--   
-- -- Whereas: -- --
--   unlines ["A", "B"] == "A\nB\n"
--   unlines [] == ""
--   
-- -- This is closer to the behaviour of unwords, which does not -- append a trailing space. unlinesConcise :: [String] -> String mapAccumLM :: (Monad m) => (acc -> x -> m (acc, y)) -> acc -> [x] -> m (acc, [y]) padRight :: Int -> String -> String dropLast :: Int -> [a] -> [a] module Test.Framework.Runners.Console defaultMain :: [Test] -> IO () defaultMainWithArgs :: [Test] -> [String] -> IO () defaultMainWithOpts :: [Test] -> RunnerOptions -> IO () instance Functor ArgDescr instance Functor OptDescr -- | A generic test framework for all types of Haskell test. -- -- For an example of how to use test-framework, please see -- http://github.com/batterseapower/test-framework/raw/master/example/Test/Framework/Example.lhs module Test.Framework -- | Something like the result of a test: works in concert with -- Testlike. The type parameters are the type that is used for -- progress reports and the type of the final output of the test -- respectively. class (Show i, Show r) => TestResultlike i r | r -> i testSucceeded :: (TestResultlike i r) => r -> Bool -- | Something test-like in its behaviour. The type parameters are the type -- that is used for progress reports, the type of the final output of the -- test and the data type encapsulating the whole potential to do a test -- respectively. class (TestResultlike i r) => Testlike i r t | t -> i r, r -> i runTest :: (Testlike i r t) => CompleteTestOptions -> t -> IO (i :~> r, IO ()) testTypeName :: (Testlike i r t) => t -> TestTypeName -- | Test names or descriptions. These are shown to the user type TestName = String -- | The name of a type of test, such as Properties or Test -- Cases. Tests of types of the same names will be grouped together -- in the test run summary. type TestTypeName = String -- | Main test data type: builds up a list of tests to be run. Users should -- use the utility functions in e.g. the test-framework-hunit and -- test-framework-quickcheck packages to create instances of Test, -- and then build them up into testsuites by using testGroup and -- lists. -- -- For an example of how to use test-framework, please see -- http://github.com/batterseapower/test-framework/raw/master/example/Test/Framework/Example.lhs data Test -- | A single test of some particular type. Test :: TestName -> t -> Test TestGroup :: TestName -> [Test] -> Test PlusTestOptions :: TestOptions -> Test -> Test -- | Assemble a number of tests into a cohesive group testGroup :: TestName -> [Test] -> Test plusTestOptions :: TestOptions -> Test -> Test