HTF-0.11.0.0: The Haskell Test Framework

Safe HaskellNone

Test.Framework.TestManager

Contents

Description

This module defines function for running a set of tests. Furthermore, it provides functionality for organzing tests into a hierarchical structure. This functionality is mainly used internally in the code generated by the hftpp pre-processor.

Synopsis

Re-exports

Running tests

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.

runTestSource

Arguments

:: TestableHTF t 
=> t

Testable thing

-> IO ExitCode

See runTestWithOptions for a specification of the ExitCode result

Run something testable using the defaultCmdlineOptions.

runTest'Source

Arguments

:: TestableHTF t 
=> t

Testable thing

-> IO (IO (), ExitCode)

IO action for printing the overall test results, and exit code for the test run. See runTestWithOptions for a specification of the ExitCode result

Run something testable using the defaultCmdlineOptions.

runTestWithArgsSource

Arguments

:: TestableHTF t 
=> [String]

Commandline arguments

-> t

Testable thing

-> IO ExitCode

See runTestWithConfig for a specification of the ExitCode result.

Run something testable, parse the CmdlineOptions from the given commandline arguments. Does not print the overall test results but returns an IO action for doing so.

runTestWithArgs'Source

Arguments

:: TestableHTF t 
=> [String]

Commandline arguments

-> t

Testable thing

-> IO (IO (), ExitCode)

IO action for printing the overall test results, and exit code for the test run. See runTestWithConfig for a specification of the ExitCode result.

Run something testable, parse the CmdlineOptions from the given commandline arguments.

runTestWithOptions :: TestableHTF t => CmdlineOptions -> t -> IO ExitCodeSource

Runs something testable with the given CmdlineOptions. See runTestWithConfig for a specification of the ExitCode result.

runTestWithOptions' :: TestableHTF t => CmdlineOptions -> t -> IO (IO (), ExitCode)Source

Runs something testable with the given CmdlineOptions. Does not print the overall test results but returns an IO action for doing so. See runTestWithConfig for a specification of the ExitCode result.

runTestWithConfig :: TestableHTF t => TestConfig -> t -> IO ExitCodeSource

Runs something testable with the given TestConfig. The result is ExitSuccess if all tests were executed successfully, ExitFailure otherwise. In the latter case, an error code of 1 indicates that failures but no errors occurred, otherwise the error code 2 is used.

A test is successful if the test terminates and no assertion fails. A test is said to fail if an assertion fails but no other error occur.

runTestWithConfig' :: TestableHTF t => TestConfig -> t -> IO (IO (), ExitCode)Source

Runs something testable with the given TestConfig. Does not print the overall test results but returns an IO action for doing so. See runTestWithConfig for a specification of the ExitCode result.

Organzing tests

class TestableHTF t Source

A type class for things that can be run as tests. Mainly used internally.

makeQuickCheckTest :: TestID -> Location -> Assertion -> TestSource

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

makeUnitTest :: AssertionWithTestOptions a => TestID -> Location -> a -> TestSource

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

makeBlackBoxTest :: TestID -> Assertion -> TestSource

Construct a black box test from the given Assertion. Mainly used internally.

makeTestSuite :: TestID -> [Test] -> TestSuiteSource

Create a named TestSuite from a list of Test values.

makeAnonTestSuite :: [Test] -> TestSuiteSource

Create an unnamed TestSuite from a list of Test values.

addToTestSuite :: TestSuite -> [Test] -> TestSuiteSource

Extend a TestSuite with a list of Test values

testSuiteAsTest :: TestSuite -> TestSource

Turn a TestSuite into a proper Test.