Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Top-level module that re-exports functionality from sub-modules.
Modules that only define unit tests and quickcheck properties typically
only need to import this module.
Test drivers should additionally import TestManager
and,
if needed, BlackBoxTest
.
See Test.Framework.Tutorial for a description how to use HTF.
Synopsis
- module Test.Framework.HUnitWrapper
- makeUnitTest :: AssertionWithTestOptions a => TestID -> Location -> a -> Test
- module Test.Framework.QuickCheckWrapper
- makeQuickCheckTest :: TestID -> Location -> Assertion -> Test
- module Test.Framework.AssertM
- makeTestSuite :: TestID -> [Test] -> TestSuite
- data TestSuite
- htfMain :: TestableHTF t => t -> IO ()
- htfMainWithArgs :: TestableHTF t => [String] -> t -> IO ()
- makeLoc :: String -> Int -> Location
- runTest :: TestableHTF t => t -> IO ExitCode
- class WrappableHTF t where
Unit tests
module Test.Framework.HUnitWrapper
makeUnitTest :: AssertionWithTestOptions a => TestID -> Location -> a -> Test Source #
Construct a unit test from the given IO
action.
Mainly used internally by the htfpp preprocessor.
Quickcheck
makeQuickCheckTest :: TestID -> Location -> Assertion -> Test Source #
Construct a test where the given Assertion
checks a quick check property.
Mainly used internally by the htfpp preprocessor.
Generic assertions
module Test.Framework.AssertM
Organizing tests
Abstract type for test suites and their results.
Instances
htfMain :: TestableHTF t => t -> IO () Source #
Runs something testable by parsing the commandline arguments as test options
(using parseTestArgs
). Exits with the exit code returned by runTestWithArgs
.
This function is the main entry point for running tests.
htfMainWithArgs :: TestableHTF t => [String] -> t -> IO () Source #
Runs something testable by parsing the commandline arguments as test options
(using parseTestArgs
). Exits with the exit code returned by runTestWithArgs
.
:: TestableHTF t | |
=> t | Testable thing |
-> IO ExitCode | See |
Run something testable using the defaultCmdlineOptions
.
class WrappableHTF t where Source #
Kind of specialised Functor
type class for tests, which allows you to
modify the Assertion
s of the WrappableHTF
-thing without changing any
test code.
E.g. if you want to add timeouts to all tests of a module, you could write:
addTimeout test = timeout 100 test >>= assertJustVerbose "Timeout exceeded" testsWithTimeouts = wrap addTimeout htf_thisModulesTests