HTF-0.13.1.0: The Haskell Test Framework

Safe HaskellNone
LanguageHaskell2010

Test.Framework

Contents

Description

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. Your test driver should additionally import TestManager and, if needed, BlackBoxTest.

Synopsis

Unit tests

makeUnitTest :: AssertionWithTestOptions a => TestID -> Location -> a -> Test #

Construct a unit test from the given IO action. Mainly used internally by the htfpp preprocessor.

Quickcheck

makeQuickCheckTest :: TestID -> Location -> Assertion -> Test #

Construct a test where the given Assertion checks a quick check property. Mainly used internally by the htfpp preprocessor.

Generic assertions

Organizing tests

makeTestSuite :: TestID -> [Test] -> TestSuite #

Create a named TestSuite from a list of Test values.

data TestSuite #

Abstract type for test suites and their results.

Instances

htfMain :: TestableHTF t => t -> IO () #

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 () #

Runs something testable by parsing the commandline arguments as test options (using parseTestArgs). Exits with the exit code returned by runTestWithArgs.

makeLoc #

Arguments

:: String

The file name

-> Int

The line number

-> Location 

Create a new location.

runTest #

Arguments

:: TestableHTF t 
=> t

Testable thing

-> IO ExitCode

See runTestWithOptions for a specification of the ExitCode result

Run something testable using the defaultCmdlineOptions.