/usr/share/doc/libghc-tasty-doc/html/Test-Tasty-Runners.html is in libghc-tasty-doc 0.11.0.2-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Test.Tasty.Runners</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Test-Tasty-Runners.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Test-Tasty-Runners.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">tasty-0.11.0.2: Modern and extensible testing framework</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell2010</td></tr></table><p class="caption">Test.Tasty.Runners</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Working with the test tree</a></li><li><a href="#g:2">Ingredients</a></li><li><a href="#g:3">Standard console ingredients</a><ul><li><a href="#g:4">Console test reporter</a></li><li><a href="#g:5">Tests list</a></li></ul></li><li><a href="#g:6">Command line handling</a></li><li><a href="#g:7">Running tests</a></li><li><a href="#g:8">Options</a><ul><li><a href="#g:9">Patterns</a></li></ul></li><li><a href="#g:10">Utilities</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>API for test runners</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">data</span> <a href="#t:TestTree">TestTree</a><ul class="subs"><li>= <span class="keyword">forall</span> t . <a href="Test-Tasty-Providers.html#t:IsTest">IsTest</a> t => <a href="#v:SingleTest">SingleTest</a> <a href="Test-Tasty-Providers.html#t:TestName">TestName</a> t</li><li>| <a href="#v:TestGroup">TestGroup</a> <a href="Test-Tasty-Providers.html#t:TestName">TestName</a> [<a href="Test-Tasty-Runners.html#t:TestTree">TestTree</a>]</li><li>| <a href="#v:PlusTestOptions">PlusTestOptions</a> (<a href="Test-Tasty-Options.html#t:OptionSet">OptionSet</a> -> <a href="Test-Tasty-Options.html#t:OptionSet">OptionSet</a>) <a href="Test-Tasty-Runners.html#t:TestTree">TestTree</a></li><li>| <span class="keyword">forall</span> a . <a href="#v:WithResource">WithResource</a> (<a href="Test-Tasty-Runners.html#t:ResourceSpec">ResourceSpec</a> a) (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a -> <a href="Test-Tasty-Runners.html#t:TestTree">TestTree</a>)</li><li>| <a href="#v:AskOptions">AskOptions</a> (<a href="Test-Tasty-Options.html#t:OptionSet">OptionSet</a> -> <a href="Test-Tasty-Runners.html#t:TestTree">TestTree</a>)</li></ul></li><li class="src short"><a href="#v:foldTestTree">foldTestTree</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Monoid.html#t:Monoid">Monoid</a> b => <a href="Test-Tasty-Runners.html#t:TreeFold">TreeFold</a> b -> <a href="Test-Tasty-Options.html#t:OptionSet">OptionSet</a> -> <a href="Test-Tasty-Runners.html#t:TestTree">TestTree</a> -> b</li><li class="src short"><span class="keyword">data</span> <a href="#t:TreeFold">TreeFold</a> b = <a href="#v:TreeFold">TreeFold</a> {<ul class="subs"><li><a href="#v:foldSingle">foldSingle</a> :: <span class="keyword">forall</span> t. <a href="Test-Tasty-Providers.html#t:IsTest">IsTest</a> t => <a href="Test-Tasty-Options.html#t:OptionSet">OptionSet</a> -> <a href="Test-Tasty-Providers.html#t:TestName">TestName</a> -> t -> b</li><li><a href="#v:foldGroup">foldGroup</a> :: <a href="Test-Tasty-Providers.html#t:TestName">TestName</a> -> b -> b</li><li><a href="#v:foldResource">foldResource</a> :: <span class="keyword">forall</span> a. <a href="Test-Tasty-Runners.html#t:ResourceSpec">ResourceSpec</a> a -> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a -> b) -> b</li></ul>}</li><li class="src short"><a href="#v:trivialFold">trivialFold</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Monoid.html#t:Monoid">Monoid</a> b => <a href="Test-Tasty-Runners.html#t:TreeFold">TreeFold</a> b</li><li class="src short"><span class="keyword">data</span> <a href="#t:ResourceSpec">ResourceSpec</a> a = <a href="#v:ResourceSpec">ResourceSpec</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a) (a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> ())</li><li class="src short"><span class="keyword">newtype</span> <a href="#t:Traversal">Traversal</a> f = <a href="#v:Traversal">Traversal</a> {<ul class="subs"><li><a href="#v:getTraversal">getTraversal</a> :: f ()</li></ul>}</li><li class="src short"><span class="keyword">newtype</span> <a href="#t:Ap">Ap</a> f a = <a href="#v:Ap">Ap</a> {<ul class="subs"><li><a href="#v:getApp">getApp</a> :: f a</li></ul>}</li><li class="src short"><span class="keyword">data</span> <a href="#t:Ingredient">Ingredient</a><ul class="subs"><li>= <a href="#v:TestReporter">TestReporter</a> [<a href="Test-Tasty-Options.html#t:OptionDescription">OptionDescription</a>] (<a href="Test-Tasty-Options.html#t:OptionSet">OptionSet</a> -> <a href="Test-Tasty-Runners.html#t:TestTree">TestTree</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Test-Tasty-Runners.html#t:StatusMap">StatusMap</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> (<a href="Test-Tasty-Runners.html#t:Time">Time</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a>)))</li><li>| <a href="#v:TestManager">TestManager</a> [<a href="Test-Tasty-Options.html#t:OptionDescription">OptionDescription</a>] (<a href="Test-Tasty-Options.html#t:OptionSet">OptionSet</a> -> <a href="Test-Tasty-Runners.html#t:TestTree">TestTree</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a>))</li></ul></li><li class="src short"><span class="keyword">type</span> <a href="#t:Time">Time</a> = <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Double">Double</a></li><li class="src short"><a href="#v:tryIngredients">tryIngredients</a> :: [<a href="Test-Tasty-Runners.html#t:Ingredient">Ingredient</a>] -> <a href="Test-Tasty-Options.html#t:OptionSet">OptionSet</a> -> <a href="Test-Tasty-Runners.html#t:TestTree">TestTree</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a>)</li><li class="src short"><a href="#v:ingredientOptions">ingredientOptions</a> :: <a href="Test-Tasty-Runners.html#t:Ingredient">Ingredient</a> -> [<a href="Test-Tasty-Options.html#t:OptionDescription">OptionDescription</a>]</li><li class="src short"><a href="#v:ingredientsOptions">ingredientsOptions</a> :: [<a href="Test-Tasty-Runners.html#t:Ingredient">Ingredient</a>] -> [<a href="Test-Tasty-Options.html#t:OptionDescription">OptionDescription</a>]</li><li class="src short"><a href="#v:consoleTestReporter">consoleTestReporter</a> :: <a href="Test-Tasty-Runners.html#t:Ingredient">Ingredient</a></li><li class="src short"><a href="#v:listingTests">listingTests</a> :: <a href="Test-Tasty-Runners.html#t:Ingredient">Ingredient</a></li><li class="src short"><span class="keyword">newtype</span> <a href="#t:ListTests">ListTests</a> = <a href="#v:ListTests">ListTests</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:testsNames">testsNames</a> :: <a href="Test-Tasty-Options.html#t:OptionSet">OptionSet</a> -> <a href="Test-Tasty-Runners.html#t:TestTree">TestTree</a> -> [<a href="Test-Tasty-Providers.html#t:TestName">TestName</a>]</li><li class="src short"><a href="#v:optionParser">optionParser</a> :: [<a href="Test-Tasty-Options.html#t:OptionDescription">OptionDescription</a>] -> <a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Types.html#t:Parser">Parser</a> <a href="Test-Tasty-Options.html#t:OptionSet">OptionSet</a></li><li class="src short"><a href="#v:suiteOptionParser">suiteOptionParser</a> :: [<a href="Test-Tasty-Runners.html#t:Ingredient">Ingredient</a>] -> <a href="Test-Tasty-Runners.html#t:TestTree">TestTree</a> -> <a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Types.html#t:Parser">Parser</a> <a href="Test-Tasty-Options.html#t:OptionSet">OptionSet</a></li><li class="src short"><a href="#v:defaultMainWithIngredients">defaultMainWithIngredients</a> :: [<a href="Test-Tasty-Runners.html#t:Ingredient">Ingredient</a>] -> <a href="Test-Tasty-Runners.html#t:TestTree">TestTree</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><span class="keyword">data</span> <a href="#t:Status">Status</a><ul class="subs"><li>= <a href="#v:NotStarted">NotStarted</a></li><li>| <a href="#v:Executing">Executing</a> <a href="Test-Tasty-Runners.html#t:Progress">Progress</a></li><li>| <a href="#v:Done">Done</a> <a href="Test-Tasty-Runners.html#t:Result">Result</a></li></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:Result">Result</a> = <a href="#v:Result">Result</a> {<ul class="subs"><li><a href="#v:resultOutcome">resultOutcome</a> :: <a href="Test-Tasty-Runners.html#t:Outcome">Outcome</a></li><li><a href="#v:resultDescription">resultDescription</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></li><li><a href="#v:resultShortDescription">resultShortDescription</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></li><li><a href="#v:resultTime">resultTime</a> :: <a href="Test-Tasty-Runners.html#t:Time">Time</a></li></ul>}</li><li class="src short"><span class="keyword">data</span> <a href="#t:Outcome">Outcome</a><ul class="subs"><li>= <a href="#v:Success">Success</a></li><li>| <a href="#v:Failure">Failure</a> <a href="Test-Tasty-Runners.html#t:FailureReason">FailureReason</a></li></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:FailureReason">FailureReason</a><ul class="subs"><li>= <a href="#v:TestFailed">TestFailed</a></li><li>| <a href="#v:TestThrewException">TestThrewException</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Exception-Base.html#t:SomeException">SomeException</a></li><li>| <a href="#v:TestTimedOut">TestTimedOut</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Integer">Integer</a></li></ul></li><li class="src short"><a href="#v:resultSuccessful">resultSuccessful</a> :: <a href="Test-Tasty-Runners.html#t:Result">Result</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:Progress">Progress</a> = <a href="#v:Progress">Progress</a> {<ul class="subs"><li><a href="#v:progressText">progressText</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></li><li><a href="#v:progressPercent">progressPercent</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Float">Float</a></li></ul>}</li><li class="src short"><span class="keyword">type</span> <a href="#t:StatusMap">StatusMap</a> = <a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.6.2/Data-IntMap-Strict.html#t:IntMap">IntMap</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/GHC-Conc.html#t:TVar">TVar</a> <a href="Test-Tasty-Runners.html#t:Status">Status</a>)</li><li class="src short"><a href="#v:launchTestTree">launchTestTree</a> :: <a href="Test-Tasty-Options.html#t:OptionSet">OptionSet</a> -> <a href="Test-Tasty-Runners.html#t:TestTree">TestTree</a> -> (<a href="Test-Tasty-Runners.html#t:StatusMap">StatusMap</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> (<a href="Test-Tasty-Runners.html#t:Time">Time</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a)) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a</li><li class="src short"><span class="keyword">newtype</span> <a href="#t:NumThreads">NumThreads</a> = <a href="#v:NumThreads">NumThreads</a> {<ul class="subs"><li><a href="#v:getNumThreads">getNumThreads</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Int.html#t:Int">Int</a></li></ul>}</li><li class="src short"><a href="#v:suiteOptions">suiteOptions</a> :: [<a href="Test-Tasty-Runners.html#t:Ingredient">Ingredient</a>] -> <a href="Test-Tasty-Runners.html#t:TestTree">TestTree</a> -> [<a href="Test-Tasty-Options.html#t:OptionDescription">OptionDescription</a>]</li><li class="src short"><a href="#v:coreOptions">coreOptions</a> :: [<a href="Test-Tasty-Options.html#t:OptionDescription">OptionDescription</a>]</li><li class="src short"><span class="keyword">data</span> <a href="#t:TestPattern">TestPattern</a></li><li class="src short"><a href="#v:parseTestPattern">parseTestPattern</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -> <a href="Test-Tasty-Runners.html#t:TestPattern">TestPattern</a></li><li class="src short"><a href="#v:noPattern">noPattern</a> :: <a href="Test-Tasty-Runners.html#t:TestPattern">TestPattern</a></li><li class="src short"><a href="#v:testPatternMatches">testPatternMatches</a> :: <a href="Test-Tasty-Runners.html#t:TestPattern">TestPattern</a> -> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>] -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:formatMessage">formatMessage</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></li></ul></div><div id="interface"><h1 id="g:1">Working with the test tree</h1><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:TestTree" class="def">TestTree</a> <a href="src/Test-Tasty-Core.html#TestTree" class="link">Source</a></p><div class="doc"><p>The main data structure defining a test suite.</p><p>It consists of individual test cases and properties, organized in named
groups which form a tree-like hierarchy.</p><p>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 <code><a href="Test-Tasty-Runners.html#t:TestTree">TestTree</a></code>.</p><p>Groups can be created using <code><a href="Test-Tasty.html#v:testGroup">testGroup</a></code>.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><span class="keyword">forall</span> t . <a href="Test-Tasty-Providers.html#t:IsTest">IsTest</a> t => <a name="v:SingleTest" class="def">SingleTest</a> <a href="Test-Tasty-Providers.html#t:TestName">TestName</a> t</td><td class="doc"><p>A single test of some particular type</p></td></tr><tr><td class="src"><a name="v:TestGroup" class="def">TestGroup</a> <a href="Test-Tasty-Providers.html#t:TestName">TestName</a> [<a href="Test-Tasty-Runners.html#t:TestTree">TestTree</a>]</td><td class="doc"><p>Assemble a number of tests into a cohesive group</p></td></tr><tr><td class="src"><a name="v:PlusTestOptions" class="def">PlusTestOptions</a> (<a href="Test-Tasty-Options.html#t:OptionSet">OptionSet</a> -> <a href="Test-Tasty-Options.html#t:OptionSet">OptionSet</a>) <a href="Test-Tasty-Runners.html#t:TestTree">TestTree</a></td><td class="doc"><p>Add some options to child tests</p></td></tr><tr><td class="src"><span class="keyword">forall</span> a . <a name="v:WithResource" class="def">WithResource</a> (<a href="Test-Tasty-Runners.html#t:ResourceSpec">ResourceSpec</a> a) (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a -> <a href="Test-Tasty-Runners.html#t:TestTree">TestTree</a>)</td><td class="doc"><p>Acquire the resource before the tests in the inner tree start and
release it after they finish. The tree gets an <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a></code> action which
yields the resource, although the resource is shared across all the
tests.</p></td></tr><tr><td class="src"><a name="v:AskOptions" class="def">AskOptions</a> (<a href="Test-Tasty-Options.html#t:OptionSet">OptionSet</a> -> <a href="Test-Tasty-Runners.html#t:TestTree">TestTree</a>)</td><td class="doc"><p>Ask for the options and customize the tests based on them</p></td></tr></table></div></div><div class="top"><p class="src"><a name="v:foldTestTree" class="def">foldTestTree</a> <a href="src/Test-Tasty-Core.html#foldTestTree" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Monoid.html#t:Monoid">Monoid</a> b</td><td class="doc empty"> </td></tr><tr><td class="src">=> <a href="Test-Tasty-Runners.html#t:TreeFold">TreeFold</a> b</td><td class="doc"><p>the algebra (i.e. how to fold a tree)</p></td></tr><tr><td class="src">-> <a href="Test-Tasty-Options.html#t:OptionSet">OptionSet</a></td><td class="doc"><p>initial options</p></td></tr><tr><td class="src">-> <a href="Test-Tasty-Runners.html#t:TestTree">TestTree</a></td><td class="doc"><p>the tree to fold</p></td></tr><tr><td class="src">-> b</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Fold a test tree into a single value.</p><p>The fold result type should be a monoid. This is used to fold multiple
results in a test group. In particular, empty groups get folded into <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Monoid.html#v:mempty">mempty</a></code>.</p><p>Apart from pure convenience, this function also does the following
useful things:</p><ol><li>Keeping track of the current options (which may change due to
<code><a href="Test-Tasty-Runners.html#v:PlusTestOptions">PlusTestOptions</a></code> nodes)</li><li>Filtering out the tests which do not match the patterns</li></ol><p>Thus, it is preferred to an explicit recursive traversal of the tree.</p><p>Note: right now, the patterns are looked up only once, and won't be
affected by the subsequent option changes. This shouldn't be a problem
in practice; OTOH, this behaviour may be changed later.</p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:TreeFold" class="def">TreeFold</a> b <a href="src/Test-Tasty-Core.html#TreeFold" class="link">Source</a></p><div class="doc"><p>An algebra for folding a <code><a href="Test-Tasty-Runners.html#t:TestTree">TestTree</a></code>.</p><p>Instead of constructing fresh records, build upon <code><a href="Test-Tasty-Runners.html#v:trivialFold">trivialFold</a></code>
instead. This way your code won't break when new nodes/fields are
indroduced.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:TreeFold" class="def">TreeFold</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:foldSingle" class="def">foldSingle</a> :: <span class="keyword">forall</span> t. <a href="Test-Tasty-Providers.html#t:IsTest">IsTest</a> t => <a href="Test-Tasty-Options.html#t:OptionSet">OptionSet</a> -> <a href="Test-Tasty-Providers.html#t:TestName">TestName</a> -> t -> b</dt><dd class="doc empty"> </dd><dt class="src"><a name="v:foldGroup" class="def">foldGroup</a> :: <a href="Test-Tasty-Providers.html#t:TestName">TestName</a> -> b -> b</dt><dd class="doc empty"> </dd><dt class="src"><a name="v:foldResource" class="def">foldResource</a> :: <span class="keyword">forall</span> a. <a href="Test-Tasty-Runners.html#t:ResourceSpec">ResourceSpec</a> a -> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a -> b) -> b</dt><dd class="doc empty"> </dd></dl><div class="clear"></div></div></td></tr></table></div></div><div class="top"><p class="src"><a name="v:trivialFold" class="def">trivialFold</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Monoid.html#t:Monoid">Monoid</a> b => <a href="Test-Tasty-Runners.html#t:TreeFold">TreeFold</a> b <a href="src/Test-Tasty-Core.html#trivialFold" class="link">Source</a></p><div class="doc"><p><code><a href="Test-Tasty-Runners.html#v:trivialFold">trivialFold</a></code> can serve as the basis for custom folds. Just override
the fields you need.</p><p>Here's what it does:</p><ul><li>single tests are mapped to <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Monoid.html#v:mempty">mempty</a></code> (you probably do want to override that)</li><li>test groups are returned unmodified</li><li>for a resource, an IO action that throws an exception is passed (you
want to override this for runners/ingredients that execute tests)</li></ul></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:ResourceSpec" class="def">ResourceSpec</a> a <a href="src/Test-Tasty-Core.html#ResourceSpec" class="link">Source</a></p><div class="doc"><p><code><a href="Test-Tasty-Runners.html#t:ResourceSpec">ResourceSpec</a></code> describes how to acquire a resource (the first field)
and how to release it (the second field).</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:ResourceSpec" class="def">ResourceSpec</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a) (a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> ())</td><td class="doc empty"> </td></tr></table></div></div><div class="top"><p class="src"><span class="keyword">newtype</span> <a name="t:Traversal" class="def">Traversal</a> f <a href="src/Test-Tasty-Runners-Reducers.html#Traversal" class="link">Source</a></p><div class="doc"><p>Monoid generated by <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#v:-42--62-">*></a></code></p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Traversal" class="def">Traversal</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:getTraversal" class="def">getTraversal</a> :: f ()</dt><dd class="doc empty"> </dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:Traversal" class="caption collapser" onclick="toggleSection('i:Traversal')">Instances</p><div id="section.i:Traversal" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a> f => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Monoid.html#t:Monoid">Monoid</a> (<a href="Test-Tasty-Runners.html#t:Traversal">Traversal</a> f)</span> <a href="src/Test-Tasty-Runners-Reducers.html#line-49" class="link">Source</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">newtype</span> <a name="t:Ap" class="def">Ap</a> f a <a href="src/Test-Tasty-Runners-Reducers.html#Ap" class="link">Source</a></p><div class="doc"><p>Monoid generated by <code><code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#v:liftA2">liftA2</a></code> (<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Monoid.html#v:-60--62-"><></a></code>)</code></p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Ap" class="def">Ap</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:getApp" class="def">getApp</a> :: f a</dt><dd class="doc empty"> </dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:Ap" class="caption collapser" onclick="toggleSection('i:Ap')">Instances</p><div id="section.i:Ap" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> f => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> (<a href="Test-Tasty-Runners.html#t:Ap">Ap</a> f)</span> <a href="src/Test-Tasty-Runners-Reducers.html#line-55" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Functor.html#t:Functor">Functor</a> f => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Functor.html#t:Functor">Functor</a> (<a href="Test-Tasty-Runners.html#t:Ap">Ap</a> f)</span> <a href="src/Test-Tasty-Runners-Reducers.html#line-55" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a> f => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a> (<a href="Test-Tasty-Runners.html#t:Ap">Ap</a> f)</span> <a href="src/Test-Tasty-Runners-Reducers.html#line-55" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left">(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a> f, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Monoid.html#t:Monoid">Monoid</a> a) => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Monoid.html#t:Monoid">Monoid</a> (<a href="Test-Tasty-Runners.html#t:Ap">Ap</a> f a)</span> <a href="src/Test-Tasty-Runners-Reducers.html#line-56" class="link">Source</a></td><td class="doc empty"> </td></tr></table></div></div></div><h1 id="g:2">Ingredients</h1><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Ingredient" class="def">Ingredient</a> <a href="src/Test-Tasty-Ingredients.html#Ingredient" class="link">Source</a></p><div class="doc"><p><code><a href="Test-Tasty-Runners.html#t:Ingredient">Ingredient</a></code>s make your test suite tasty.</p><p>Ingredients represent different actions that you can perform on your
test suite. One obvious ingredient that you want to include is
one that runs tests and reports the progress and results.</p><p>Another standard ingredient is one that simply prints the names of all
tests.</p><p>Similar to test providers (see <code><a href="Test-Tasty-Providers.html#t:IsTest">IsTest</a></code>), every ingredient may specify
which options it cares about, so that those options are presented to
the user if the ingredient is included in the test suite.</p><p>An ingredient can choose, typically based on the <code><a href="Test-Tasty-Options.html#t:OptionSet">OptionSet</a></code>, whether to
run. That's what the <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a></code> is for. The first ingredient that agreed to
run does its work, and the remaining ingredients are ignored. Thus, the
order in which you arrange the ingredients may matter.</p><p>Usually, the ingredient which runs the tests is unconditional and thus
should be placed last in the list. Other ingredients usually run only
if explicitly requested via an option. Their relative order thus doesn't
matter.</p><p>That's all you need to know from an (advanced) user perspective. Read
on if you want to create a new ingredient.</p><p>There are two kinds of ingredients.</p><p>The first kind is <code><a href="Test-Tasty-Runners.html#v:TestReporter">TestReporter</a></code>. If the ingredient that agrees to run
is a <code><a href="Test-Tasty-Runners.html#v:TestReporter">TestReporter</a></code>, then tasty will automatically launch the tests and
pass a <code><a href="Test-Tasty-Runners.html#t:StatusMap">StatusMap</a></code> to the ingredient. All the ingredient needs to do
then is to process the test results and probably report them to the user
in some way (hence the name).</p><p><code><a href="Test-Tasty-Runners.html#v:TestManager">TestManager</a></code> is the second kind of ingredient. It is typically used for
test management purposes (such as listing the test names), although it
can also be used for running tests (but, unlike <code><a href="Test-Tasty-Runners.html#v:TestReporter">TestReporter</a></code>, it has
to launch the tests manually if it wants them to be run). It is
therefore more general than <code><a href="Test-Tasty-Runners.html#v:TestReporter">TestReporter</a></code>. <code><a href="Test-Tasty-Runners.html#v:TestReporter">TestReporter</a></code> is provided
just for convenience.</p><p>The function's result should indicate whether all the tests passed.</p><p>In the <code><a href="Test-Tasty-Runners.html#v:TestManager">TestManager</a></code> case, it's up to the ingredient author to decide
what the result should be. When no tests are run, the result should
probably be <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#v:True">True</a></code>. Sometimes, even if some tests run and fail, it still
makes sense to return <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#v:True">True</a></code>.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:TestReporter" class="def">TestReporter</a> [<a href="Test-Tasty-Options.html#t:OptionDescription">OptionDescription</a>] (<a href="Test-Tasty-Options.html#t:OptionSet">OptionSet</a> -> <a href="Test-Tasty-Runners.html#t:TestTree">TestTree</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Test-Tasty-Runners.html#t:StatusMap">StatusMap</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> (<a href="Test-Tasty-Runners.html#t:Time">Time</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a>)))</td><td class="doc"><p>For the explanation on how the callback works, see the
documentation for <code><a href="Test-Tasty-Runners.html#v:launchTestTree">launchTestTree</a></code>.</p></td></tr><tr><td class="src"><a name="v:TestManager" class="def">TestManager</a> [<a href="Test-Tasty-Options.html#t:OptionDescription">OptionDescription</a>] (<a href="Test-Tasty-Options.html#t:OptionSet">OptionSet</a> -> <a href="Test-Tasty-Runners.html#t:TestTree">TestTree</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a>))</td><td class="doc empty"> </td></tr></table></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:Time" class="def">Time</a> = <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Double">Double</a> <a href="src/Test-Tasty-Core.html#Time" class="link">Source</a></p><div class="doc"><p>Time in seconds. Used to measure how long the tests took to run.</p></div></div><div class="top"><p class="src"><a name="v:tryIngredients" class="def">tryIngredients</a> :: [<a href="Test-Tasty-Runners.html#t:Ingredient">Ingredient</a>] -> <a href="Test-Tasty-Options.html#t:OptionSet">OptionSet</a> -> <a href="Test-Tasty-Runners.html#t:TestTree">TestTree</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a>) <a href="src/Test-Tasty-Ingredients.html#tryIngredients" class="link">Source</a></p><div class="doc"><p>Run the first <code><a href="Test-Tasty-Runners.html#t:Ingredient">Ingredient</a></code> that agrees to be run.</p><p>If no one accepts the task, return <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#v:Nothing">Nothing</a></code>. This is usually a sign of
misconfiguration.</p></div></div><div class="top"><p class="src"><a name="v:ingredientOptions" class="def">ingredientOptions</a> :: <a href="Test-Tasty-Runners.html#t:Ingredient">Ingredient</a> -> [<a href="Test-Tasty-Options.html#t:OptionDescription">OptionDescription</a>] <a href="src/Test-Tasty-Ingredients.html#ingredientOptions" class="link">Source</a></p><div class="doc"><p>Return the options which are relevant for the given ingredient.</p><p>Note that this isn't the same as simply pattern-matching on
<code><a href="Test-Tasty-Runners.html#t:Ingredient">Ingredient</a></code>. E.g. options for a <code><a href="Test-Tasty-Runners.html#v:TestReporter">TestReporter</a></code> automatically include
<code><a href="Test-Tasty-Runners.html#t:NumThreads">NumThreads</a></code>.</p></div></div><div class="top"><p class="src"><a name="v:ingredientsOptions" class="def">ingredientsOptions</a> :: [<a href="Test-Tasty-Runners.html#t:Ingredient">Ingredient</a>] -> [<a href="Test-Tasty-Options.html#t:OptionDescription">OptionDescription</a>] <a href="src/Test-Tasty-Ingredients.html#ingredientsOptions" class="link">Source</a></p><div class="doc"><p>Like <code>ingredientOption</code>, but folds over multiple ingredients.</p></div></div><h1 id="g:3">Standard console ingredients</h1><div class="doc"><p>NOTE: the exports in this section are deprecated and will be
removed in the future. Please import <a href="Test-Tasty-Ingredients-Basic.html">Test.Tasty.Ingredients.Basic</a>
if you need them.</p></div><h2 id="g:4">Console test reporter</h2><div class="top"><p class="src"><a name="v:consoleTestReporter" class="def">consoleTestReporter</a> :: <a href="Test-Tasty-Runners.html#t:Ingredient">Ingredient</a> <a href="src/Test-Tasty-Ingredients-ConsoleReporter.html#consoleTestReporter" class="link">Source</a></p><div class="doc"><p>A simple console UI</p></div></div><h2 id="g:5">Tests list</h2><div class="top"><p class="src"><a name="v:listingTests" class="def">listingTests</a> :: <a href="Test-Tasty-Runners.html#t:Ingredient">Ingredient</a> <a href="src/Test-Tasty-Ingredients-ListTests.html#listingTests" class="link">Source</a></p><div class="doc"><p>The ingredient that provides the test listing functionality</p></div></div><div class="top"><p class="src"><span class="keyword">newtype</span> <a name="t:ListTests" class="def">ListTests</a> <a href="src/Test-Tasty-Ingredients-ListTests.html#ListTests" class="link">Source</a></p><div class="doc"><p>This option, when set to <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#v:True">True</a></code>, specifies that we should run in the
«list tests» mode</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:ListTests" class="def">ListTests</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:ListTests" class="caption collapser" onclick="toggleSection('i:ListTests')">Instances</p><div id="section.i:ListTests" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Eq.html#t:Eq">Eq</a> <a href="Test-Tasty-Runners.html#t:ListTests">ListTests</a></span> <a href="src/Test-Tasty-Ingredients-ListTests.html#line-19" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Ord.html#t:Ord">Ord</a> <a href="Test-Tasty-Runners.html#t:ListTests">ListTests</a></span> <a href="src/Test-Tasty-Ingredients-ListTests.html#line-19" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Test-Tasty-Options.html#t:IsOption">IsOption</a> <a href="Test-Tasty-Runners.html#t:ListTests">ListTests</a></span> <a href="src/Test-Tasty-Ingredients-ListTests.html#line-20" class="link">Source</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:testsNames" class="def">testsNames</a> :: <a href="Test-Tasty-Options.html#t:OptionSet">OptionSet</a> -> <a href="Test-Tasty-Runners.html#t:TestTree">TestTree</a> -> [<a href="Test-Tasty-Providers.html#t:TestName">TestName</a>] <a href="src/Test-Tasty-Ingredients-ListTests.html#testsNames" class="link">Source</a></p><div class="doc"><p>Obtain the list of all tests in the suite</p></div></div><h1 id="g:6">Command line handling</h1><div class="top"><p class="src"><a name="v:optionParser" class="def">optionParser</a> :: [<a href="Test-Tasty-Options.html#t:OptionDescription">OptionDescription</a>] -> <a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Types.html#t:Parser">Parser</a> <a href="Test-Tasty-Options.html#t:OptionSet">OptionSet</a> <a href="src/Test-Tasty-CmdLine.html#optionParser" class="link">Source</a></p><div class="doc"><p>Generate a command line parser from a list of option descriptions</p></div></div><div class="top"><p class="src"><a name="v:suiteOptionParser" class="def">suiteOptionParser</a> :: [<a href="Test-Tasty-Runners.html#t:Ingredient">Ingredient</a>] -> <a href="Test-Tasty-Runners.html#t:TestTree">TestTree</a> -> <a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Types.html#t:Parser">Parser</a> <a href="Test-Tasty-Options.html#t:OptionSet">OptionSet</a> <a href="src/Test-Tasty-CmdLine.html#suiteOptionParser" class="link">Source</a></p><div class="doc"><p>The command line parser for the test suite</p></div></div><div class="top"><p class="src"><a name="v:defaultMainWithIngredients" class="def">defaultMainWithIngredients</a> :: [<a href="Test-Tasty-Runners.html#t:Ingredient">Ingredient</a>] -> <a href="Test-Tasty-Runners.html#t:TestTree">TestTree</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> () <a href="src/Test-Tasty-CmdLine.html#defaultMainWithIngredients" class="link">Source</a></p><div class="doc"><p>Parse the command line arguments and run the tests using the provided
ingredient list</p></div></div><h1 id="g:7">Running tests</h1><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Status" class="def">Status</a> <a href="src/Test-Tasty-Run.html#Status" class="link">Source</a></p><div class="doc"><p>Current status of a test</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:NotStarted" class="def">NotStarted</a></td><td class="doc"><p>test has not started running yet</p></td></tr><tr><td class="src"><a name="v:Executing" class="def">Executing</a> <a href="Test-Tasty-Runners.html#t:Progress">Progress</a></td><td class="doc"><p>test is being run</p></td></tr><tr><td class="src"><a name="v:Done" class="def">Done</a> <a href="Test-Tasty-Runners.html#t:Result">Result</a></td><td class="doc"><p>test finished with a given result</p></td></tr></table></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Result" class="def">Result</a> <a href="src/Test-Tasty-Core.html#Result" class="link">Source</a></p><div class="doc"><p>A test result</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Result" class="def">Result</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:resultOutcome" class="def">resultOutcome</a> :: <a href="Test-Tasty-Runners.html#t:Outcome">Outcome</a></dt><dd class="doc"><p>Did the test fail? If so, why?</p></dd><dt class="src"><a name="v:resultDescription" class="def">resultDescription</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></dt><dd class="doc"><p><code><a href="Test-Tasty-Runners.html#v:resultDescription">resultDescription</a></code> may contain some details about the test. For
a passed test it's ok to leave it empty. Providers like SmallCheck and
QuickCheck use it to provide information about how many tests were
generated.</p><p>For a failed test, <code><a href="Test-Tasty-Runners.html#v:resultDescription">resultDescription</a></code> should typically provide more
information about the failure.</p></dd><dt class="src"><a name="v:resultShortDescription" class="def">resultShortDescription</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></dt><dd class="doc"><p>The short description printed in the test run summary, usually <code>OK</code> or
<code>FAIL</code>.</p></dd><dt class="src"><a name="v:resultTime" class="def">resultTime</a> :: <a href="Test-Tasty-Runners.html#t:Time">Time</a></dt><dd class="doc"><p>How long it took to run the test, in seconds.</p></dd></dl><div class="clear"></div></div></td></tr></table></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Outcome" class="def">Outcome</a> <a href="src/Test-Tasty-Core.html#Outcome" class="link">Source</a></p><div class="doc"><p>Outcome of a test run</p><p>Note: this is isomorphic to <code><code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a></code> <code><a href="Test-Tasty-Runners.html#t:FailureReason">FailureReason</a></code></code>. You can use the
<code>generic-maybe</code> package to exploit that.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Success" class="def">Success</a></td><td class="doc"><p>test succeeded</p></td></tr><tr><td class="src"><a name="v:Failure" class="def">Failure</a> <a href="Test-Tasty-Runners.html#t:FailureReason">FailureReason</a></td><td class="doc"><p>test failed because of the <code><a href="Test-Tasty-Runners.html#t:FailureReason">FailureReason</a></code></p></td></tr></table></div><div class="subs instances"><p id="control.i:Outcome" class="caption collapser" onclick="toggleSection('i:Outcome')">Instances</p><div id="section.i:Outcome" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Text-Show.html#t:Show">Show</a> <a href="Test-Tasty-Runners.html#t:Outcome">Outcome</a></span> <a href="src/Test-Tasty-Core.html#line-40" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/GHC-Generics.html#t:Generic">Generic</a> <a href="Test-Tasty-Runners.html#t:Outcome">Outcome</a></span> <a href="src/Test-Tasty-Core.html#line-40" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="keyword">type</span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/GHC-Generics.html#t:Rep">Rep</a> <a href="Test-Tasty-Runners.html#t:Outcome">Outcome</a></span> <a href="src/Test-Tasty-Core.html#line-37" class="link">Source</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:FailureReason" class="def">FailureReason</a> <a href="src/Test-Tasty-Core.html#FailureReason" class="link">Source</a></p><div class="doc"><p>If a test failed, <code><a href="Test-Tasty-Runners.html#t:FailureReason">FailureReason</a></code> describes why</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:TestFailed" class="def">TestFailed</a></td><td class="doc"><p>test provider indicated failure of the code to test, either because
the tested code returned wrong results, or raised an exception</p></td></tr><tr><td class="src"><a name="v:TestThrewException" class="def">TestThrewException</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Exception-Base.html#t:SomeException">SomeException</a></td><td class="doc"><p>the test code itself raised an exception. Typical cases include missing
example input or output files.</p><p>Usually, providers do not have to implement this, as their <code><a href="Test-Tasty-Providers.html#v:run">run</a></code> method
may simply raise an exception.</p></td></tr><tr><td class="src"><a name="v:TestTimedOut" class="def">TestTimedOut</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Integer">Integer</a></td><td class="doc"><p>test didn't complete in allotted time</p></td></tr></table></div><div class="subs instances"><p id="control.i:FailureReason" class="caption collapser" onclick="toggleSection('i:FailureReason')">Instances</p><div id="section.i:FailureReason" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Text-Show.html#t:Show">Show</a> <a href="Test-Tasty-Runners.html#t:FailureReason">FailureReason</a></span> <a href="src/Test-Tasty-Core.html#line-31" class="link">Source</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:resultSuccessful" class="def">resultSuccessful</a> :: <a href="Test-Tasty-Runners.html#t:Result">Result</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Test-Tasty-Core.html#resultSuccessful" class="link">Source</a></p><div class="doc"><p><code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#v:True">True</a></code> for a passed test, <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#v:False">False</a></code> for a failed one.</p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Progress" class="def">Progress</a> <a href="src/Test-Tasty-Core.html#Progress" class="link">Source</a></p><div class="doc"><p>Test progress information.</p><p>This may be used by a runner to provide some feedback to the user while
a long-running test is executing.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Progress" class="def">Progress</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:progressText" class="def">progressText</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></dt><dd class="doc"><p>textual information about the test's progress</p></dd><dt class="src"><a name="v:progressPercent" class="def">progressPercent</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Float">Float</a></dt><dd class="doc"><p><code><a href="Test-Tasty-Runners.html#v:progressPercent">progressPercent</a></code> should be a value between 0 and 1. If it's impossible
to compute the estimate, use 0.</p></dd></dl><div class="clear"></div></div></td></tr></table></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:StatusMap" class="def">StatusMap</a> = <a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.6.2/Data-IntMap-Strict.html#t:IntMap">IntMap</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/GHC-Conc.html#t:TVar">TVar</a> <a href="Test-Tasty-Runners.html#t:Status">Status</a>) <a href="src/Test-Tasty-Run.html#StatusMap" class="link">Source</a></p><div class="doc"><p>Mapping from test numbers (starting from 0) to their status variables.</p><p>This is what an ingredient uses to analyse and display progress, and to
detect when tests finish.</p></div></div><div class="top"><p class="src"><a name="v:launchTestTree" class="def">launchTestTree</a> <a href="src/Test-Tasty-Run.html#launchTestTree" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Test-Tasty-Options.html#t:OptionSet">OptionSet</a></td><td class="doc empty"> </td></tr><tr><td class="src">-> <a href="Test-Tasty-Runners.html#t:TestTree">TestTree</a></td><td class="doc empty"> </td></tr><tr><td class="src">-> (<a href="Test-Tasty-Runners.html#t:StatusMap">StatusMap</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> (<a href="Test-Tasty-Runners.html#t:Time">Time</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a))</td><td class="doc"><p>A callback. First, it receives the <code><a href="Test-Tasty-Runners.html#t:StatusMap">StatusMap</a></code> through which it
can observe the execution of tests in real time. Typically (but not
necessarily), it waits until all the tests are finished.</p><p>After this callback returns, the test-running threads (if any) are
terminated and all resources acquired by tests are released.</p><p>The callback must return another callback (of type <code><code><a href="Test-Tasty-Runners.html#t:Time">Time</a></code> -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a></code>
a</code>) which additionally can report and/or record the total time
taken by the test suite. This time includes the time taken to run
all resource initializers and finalizers, which is why it is more
accurate than what could be measured from inside the first callback.</p></td></tr><tr><td class="src">-> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Start running all the tests in a test tree in parallel, without
blocking the current thread. The number of test running threads is
determined by the <code><a href="Test-Tasty-Runners.html#t:NumThreads">NumThreads</a></code> option.</p></div></div><div class="top"><p class="src"><span class="keyword">newtype</span> <a name="t:NumThreads" class="def">NumThreads</a> <a href="src/Test-Tasty-Options-Core.html#NumThreads" class="link">Source</a></p><div class="doc"><p>Number of parallel threads to use for running tests.</p><p>Note that this is <em>not</em> included in <code><a href="Test-Tasty-Runners.html#v:coreOptions">coreOptions</a></code>.
Instead, it's automatically included in the options for any
<code>TestReporter</code> ingredient by <code>ingredientOptions</code>, because the way test
reporters are handled already involves parallelism. Other ingredients
may also choose to include this option.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:NumThreads" class="def">NumThreads</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:getNumThreads" class="def">getNumThreads</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Int.html#t:Int">Int</a></dt><dd class="doc empty"> </dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:NumThreads" class="caption collapser" onclick="toggleSection('i:NumThreads')">Instances</p><div id="section.i:NumThreads" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Eq.html#t:Eq">Eq</a> <a href="Test-Tasty-Runners.html#t:NumThreads">NumThreads</a></span> <a href="src/Test-Tasty-Options-Core.html#line-31" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Num">Num</a> <a href="Test-Tasty-Runners.html#t:NumThreads">NumThreads</a></span> <a href="src/Test-Tasty-Options-Core.html#line-31" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Ord.html#t:Ord">Ord</a> <a href="Test-Tasty-Runners.html#t:NumThreads">NumThreads</a></span> <a href="src/Test-Tasty-Options-Core.html#line-31" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Test-Tasty-Options.html#t:IsOption">IsOption</a> <a href="Test-Tasty-Runners.html#t:NumThreads">NumThreads</a></span> <a href="src/Test-Tasty-Options-Core.html#line-32" class="link">Source</a></td><td class="doc empty"> </td></tr></table></div></div></div><h1 id="g:8">Options</h1><div class="top"><p class="src"><a name="v:suiteOptions" class="def">suiteOptions</a> :: [<a href="Test-Tasty-Runners.html#t:Ingredient">Ingredient</a>] -> <a href="Test-Tasty-Runners.html#t:TestTree">TestTree</a> -> [<a href="Test-Tasty-Options.html#t:OptionDescription">OptionDescription</a>] <a href="src/Test-Tasty-Ingredients.html#suiteOptions" class="link">Source</a></p><div class="doc"><p>All the options relevant for this test suite. This includes the
options for the test tree and ingredients, and the core options.</p></div></div><div class="top"><p class="src"><a name="v:coreOptions" class="def">coreOptions</a> :: [<a href="Test-Tasty-Options.html#t:OptionDescription">OptionDescription</a>] <a href="src/Test-Tasty-Options-Core.html#coreOptions" class="link">Source</a></p><div class="doc"><p>The list of all core options, i.e. the options not specific to any
provider or ingredient, but to tasty itself. Currently contains
<code><a href="Test-Tasty-Runners.html#t:TestPattern">TestPattern</a></code> and <code><a href="Test-Tasty.html#t:Timeout">Timeout</a></code>.</p></div></div><h2 id="g:9">Patterns</h2><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:TestPattern" class="def">TestPattern</a> <a href="src/Test-Tasty-Patterns.html#TestPattern" class="link">Source</a></p><div class="doc"><p>A pattern to filter tests. For the syntax description, see
<a href="http://documentup.com/feuerbach/tasty#using-patterns">http://documentup.com/feuerbach/tasty#using-patterns</a></p></div><div class="subs instances"><p id="control.i:TestPattern" class="caption collapser" onclick="toggleSection('i:TestPattern')">Instances</p><div id="section.i:TestPattern" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Text-Read.html#t:Read">Read</a> <a href="Test-Tasty-Runners.html#t:TestPattern">TestPattern</a></span> <a href="src/Test-Tasty-Patterns.html#line-83" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Text-Show.html#t:Show">Show</a> <a href="Test-Tasty-Runners.html#t:TestPattern">TestPattern</a></span> <a href="src/Test-Tasty-Patterns.html#line-77" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Test-Tasty-Options.html#t:IsOption">IsOption</a> <a href="Test-Tasty-Runners.html#t:TestPattern">TestPattern</a></span> <a href="src/Test-Tasty-Patterns.html#line-86" class="link">Source</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:parseTestPattern" class="def">parseTestPattern</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -> <a href="Test-Tasty-Runners.html#t:TestPattern">TestPattern</a> <a href="src/Test-Tasty-Patterns.html#parseTestPattern" class="link">Source</a></p><div class="doc"><p>Parse a pattern</p></div></div><div class="top"><p class="src"><a name="v:noPattern" class="def">noPattern</a> :: <a href="Test-Tasty-Runners.html#t:TestPattern">TestPattern</a> <a href="src/Test-Tasty-Patterns.html#noPattern" class="link">Source</a></p><div class="doc"><p>A pattern that matches anything.</p></div></div><div class="top"><p class="src"><a name="v:testPatternMatches" class="def">testPatternMatches</a> :: <a href="Test-Tasty-Runners.html#t:TestPattern">TestPattern</a> -> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>] -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Test-Tasty-Patterns.html#testPatternMatches" class="link">Source</a></p><div class="doc"><p>Test a path (which is the sequence of group titles, possibly followed
by the test title) against a pattern</p></div></div><h1 id="g:10">Utilities</h1><div class="top"><p class="src"><a name="v:formatMessage" class="def">formatMessage</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> <a href="src/Test-Tasty-Runners-Utils.html#formatMessage" class="link">Source</a></p><div class="doc"><p>Catch possible exceptions that may arise when evaluating a string.
For normal (total) strings, this is a no-op.</p><p>This function should be used to display messages generated by the test
suite (such as test result descriptions).</p><p>See e.g. <a href="https://github.com/feuerbach/tasty/issues/25">https://github.com/feuerbach/tasty/issues/25</a></p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.16.1</p></div></body></html>
|