Safe Haskell | Safe-Inferred |
---|
This module defines types (and small auxiliary functions) for organizing tests, for configuring the execution of tests, and for representing and reporting their results.
- type TestID = String
- type Assertion = IO ()
- data Test
- data TestSuite
- = TestSuite TestID [Test]
- | AnonTestSuite [Test]
- data TestSort
- data TestPath
- data GenFlatTest a = FlatTest {
- ft_sort :: TestSort
- ft_path :: TestPath
- ft_location :: Maybe Location
- ft_payload :: a
- type FlatTest = GenFlatTest Assertion
- type TestFilter = FlatTest -> Bool
- testPathToList :: TestPath -> [Maybe TestID]
- flatName :: TestPath -> String
- type TR = RWST TestConfig () TestState IO
- data TestState = TestState {
- ts_results :: [FlatTestResult]
- ts_index :: Int
- initTestState :: TestState
- data TestConfig = TestConfig {}
- data TestOutput
- type ReportAllTests = [FlatTest] -> TR ()
- type ReportGlobalStart = [FlatTest] -> TR ()
- type ReportTestStart = FlatTest -> TR ()
- type ReportTestResult = FlatTestResult -> TR ()
- type ReportGlobalResults = Milliseconds -> [FlatTestResult] -> [FlatTestResult] -> [FlatTestResult] -> [FlatTestResult] -> TR ()
- data TestReporter = TestReporter {}
- data TestResult
- type FlatTestResult = GenFlatTest RunResult
- type Milliseconds = Int
- data RunResult = RunResult {}
Organizing tests
Abstract type for tests and their results.
Abstract type for test suites and their results.
Type for distinguishing different sorts of tests.
A type denoting the hierarchical name of a test.
data GenFlatTest a Source
Generic type for flattened tests and their results.
FlatTest | |
|
type FlatTest = GenFlatTest AssertionSource
Flattened representation of tests.
type TestFilter = FlatTest -> BoolSource
testPathToList :: TestPath -> [Maybe TestID]Source
Splits a TestPath
into a list of test identifiers.
Executing tests
The state type for the TR
monad.
TestState | |
|
initTestState :: TestStateSource
The initial test state.
data TestConfig Source
Configuration of test execution.
TestConfig | |
|
data TestOutput Source
The destination of progress and result messages from HTF.
TestOutputHandle Handle Bool | Output goes to |
TestOutputSplitted FilePath | Output goes to files whose names are derived from |
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 ReportGlobalResultsSource
= Milliseconds | wall time in ms |
-> [FlatTestResult] | passed tests |
-> [FlatTestResult] | pending tests |
-> [FlatTestResult] | failed tests |
-> [FlatTestResult] | erroneous tests |
-> TR () |
Reports the overall results of all tests.
data TestReporter Source
A TestReporter
provides hooks to customize the output of HTF.
TestReporter | |
|
Specifying results.
data TestResult Source
The summary result of a test.
type FlatTestResult = GenFlatTest RunResultSource
The result of running a FlatTest
type Milliseconds = IntSource
A type synonym for time in milliseconds.
The result of a test run.
RunResult | |
|