test-framework 0.2.0 → 0.2.1
raw patch · 3 files changed
+23/−7 lines, 3 files
Files
- Test/Framework.hs +4/−0
- Test/Framework/Core.hs +17/−5
- test-framework.cabal +2/−2
Test/Framework.hs view
@@ -1,3 +1,7 @@+-- | 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 ( module Test.Framework.Core, module Test.Framework.Options,
Test/Framework/Core.hs view
@@ -4,11 +4,15 @@ import Test.Framework.Options --- | Something like the result of a test: works in concert with 'Testlike'+-- | 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 where testSucceeded :: r -> Bool --- | Something test-like in its behaviour+-- | 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 where runTest :: CompleteTestOptions -> t -> IO (i :~> r, IO ()) testTypeName :: t -> TestTypeName@@ -17,14 +21,22 @@ -- | 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"+-- | 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: build up a list of tests to be run with this.-data Test = forall i r t. Testlike i r t => Test TestName t+-- | 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 = forall i r t. Testlike i r t => Test TestName t -- ^ A single test of some particular type. | TestGroup TestName [Test] | PlusTestOptions TestOptions Test +-- | Assemble a number of tests into a cohesive group testGroup :: TestName -> [Test] -> Test testGroup = TestGroup
test-framework.cabal view
@@ -1,6 +1,6 @@ Name: test-framework-Version: 0.2.0-Cabal-Version: >= 1.2+Version: 0.2.1+Cabal-Version: >= 1.2.3 Category: Testing Synopsis: Framework for running and organising tests, with HUnit and QuickCheck support Description: Allows tests such as QuickCheck properties and HUnit test cases to be assembled into test groups, run in