tasty-0.3: Modern and extensible testing framework

Safe HaskellNone

Test.Tasty

Contents

Description

This module defines the main data types and functions needed to use Tasty.

Synopsis

Organizing tests

type TestName = StringSource

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.

testGroup :: TestName -> [TestTree] -> TestTreeSource

Create a named group of test cases or other groups

Running tests

defaultMain :: TestTree -> IO ()Source

Parse the command line arguments and run the tests using the standard console runner

defaultMainWithRunner :: Runner -> TestTree -> IO ()Source

Parse the command line arguments and run the tests using the provided runner

Adjusting options

Normally options are specified on the command line. But you can also have different options for different subtrees in the same tree, using the functions below.

adjustOption :: IsOption v => (v -> v) -> TestTree -> TestTreeSource

Locally adjust the option value for the given test subtree

localOption :: IsOption v => v -> TestTree -> TestTreeSource

Locally set the option value for the given test subtree