tasty-1.4.0.3: Modern and extensible testing framework
Safe HaskellNone
LanguageHaskell2010

Test.Tasty.Providers

Description

API for test providers

Synopsis

Documentation

class Typeable t => IsTest t where Source #

The interface to be implemented by a test provider.

The type t is the concrete representation of the test which is used by the provider.

Methods

run Source #

Arguments

:: OptionSet

options

-> t

the test to run

-> (Progress -> IO ())

a callback to report progress. Note: the callback is a no-op at the moment and there are no plans to use it; feel free to ignore this argument for now.

-> IO Result 

Run the test

This method should cleanly catch any exceptions in the code to test, and return them as part of the Result, see FailureReason for an explanation. It is ok for run to raise an exception if there is a problem with the test suite code itself (for example, if a file that should contain example data or expected output is not found).

testOptions :: Tagged t [OptionDescription] Source #

The list of options that affect execution of tests of this type

testPassed Source #

Arguments

:: String

description (may be empty)

-> Result 

Result of a passed test

testFailed Source #

Arguments

:: String

description

-> Result 

Result of a failed test

testFailedDetails Source #

Arguments

:: String

description

-> ResultDetailsPrinter

details printer

-> Result 

Result of a failed test with custom details printer

Since: 1.3.1

data Result Source #

A test result

Instances

Instances details
Show Result Source # 
Instance details

Defined in Test.Tasty.Core

data Progress Source #

Test progress information.

This may be used by a runner to provide some feedback to the user while a long-running test is executing.

Constructors

Progress 

Fields

Instances

Instances details
Show Progress Source # 
Instance details

Defined in Test.Tasty.Core

type TestName = String Source #

The name of a test or a group of tests

data TestTree Source #

The main data structure defining a test suite.

It consists of individual test cases and properties, organized in named groups which form a tree-like hierarchy.

There is no generic way to create a test case. Instead, every test provider (tasty-hunit, tasty-smallcheck etc.) provides a function to turn a test case into a TestTree.

Groups can be created using testGroup.

singleTest :: IsTest t => TestName -> t -> TestTree Source #

Convert a test to a leaf of the TestTree