HTF-0.14.0.3: The Haskell Test Framework

Safe HaskellNone
LanguageHaskell2010

Test.Framework.TestTypes

Contents

Description

This module defines types (and small auxiliary functions) for organizing tests, for configuring the execution of tests, and for representing and reporting their results.

Synopsis

Organizing tests

type TestID = String Source #

Type for naming tests.

data Test Source #

Abstract type for tests and their results.

Instances
TestableHTF Test Source # 
Instance details

Defined in Test.Framework.TestManager

Methods

flatten :: Test -> [FlatTest]

WrappableHTF Test Source # 
Instance details

Defined in Test.Framework.TestManager

Methods

wrap :: (Assertion -> Assertion) -> Test -> Test Source #

data TestSuite Source #

Abstract type for test suites and their results.

Instances
TestableHTF TestSuite Source # 
Instance details

Defined in Test.Framework.TestManager

Methods

flatten :: TestSuite -> [FlatTest]

WrappableHTF TestSuite Source # 
Instance details

Defined in Test.Framework.TestManager

data TestSort Source #

Type for distinguishing different sorts of tests.

data TestPath Source #

A type denoting the hierarchical name of a test.

data GenFlatTest a Source #

Generic type for flattened tests and their results.

Constructors

FlatTest 

Fields

type FlatTest = GenFlatTest (WithTestOptions Assertion) Source #

Flattened representation of tests.

type TestFilter = FlatTest -> Bool Source #

A filter is a predicate on GenFlatTest. If the predicate is True, the flat test is run.

testPathToList :: TestPath -> [Maybe TestID] Source #

Splits a TestPath into a list of test identifiers.

flatName :: TestPath -> String Source #

Creates a string representation from a TestPath.

finalName :: TestPath -> String Source #

Returns the final name of a TestPath

prefixName :: TestPath -> String Source #

Returns the name of the prefix of a test path. The prefix is everything except the last element.

withOptions :: (TestOptions -> TestOptions) -> a -> WithTestOptions a Source #

Shortcut for constructing a WithTestOptions value.

historyKey :: GenFlatTest a -> Text Source #

Key of a flat test for the history database.

Executing tests

type TR = RWST TestConfig () TestState IO Source #

The TR (test runner) monad.

data TestState Source #

The state type for the TR monad.

Constructors

TestState 

Fields

initTestState :: TestState Source #

The initial test state.

data TestConfig Source #

Configuration of test execution.

Constructors

TestConfig 

Fields

Instances
Show TestConfig Source # 
Instance details

Defined in Test.Framework.TestTypes

data TestOutput Source #

The destination of progress and result messages from HTF.

Constructors

TestOutputHandle Handle Bool

Output goes to Handle, boolean flag indicates whether the handle should be closed at the end.

TestOutputSplitted FilePath

Output goes to files whose names are derived from FilePath by appending a number to it. Numbering starts at zero.

Instances
Eq TestOutput Source # 
Instance details

Defined in Test.Framework.TestTypes

Show TestOutput Source # 
Instance details

Defined in Test.Framework.TestTypes

Reporting results

type ReportAllTests = [FlatTest] -> TR () Source #

Reports the IDs of all tests available.

type ReportGlobalStart = [FlatTest] -> TR () Source #

Signals that test execution is about to start.

type ReportTestStart = FlatTest -> TR () Source #

Reports the start of a single test.

type ReportTestResult = FlatTestResult -> TR () Source #

Reports the result of a single test.

type ReportGlobalResults = ReportGlobalResultsArg -> TR () Source #

Reports the overall results of all tests.

data TestReporter Source #

A TestReporter provides hooks to customize the output of HTF.

Constructors

TestReporter 

Fields

type CallStack = [(Maybe String, Location)] Source #

A type for call-stacks

Specifying results.

type FlatTestResult = GenFlatTest RunResult Source #

The result of running a GenFlatTest

type Milliseconds = Int Source #

A type synonym for time in milliseconds.

data RunResult Source #

The result of a test run.

Constructors

RunResult 

Fields