| Copyright | Oliver Charles (c) 2014 Andrew Lelechenko (c) 2019 |
|---|---|
| License | BSD3 |
| Safe Haskell | None |
| Language | Haskell2010 |
Test.Tasty.Ingredients.Rerun
Description
This ingredient for tasty testing framework allows to filter a test tree depending on an outcome of the previous run. This may be useful in many scenarios, especially when a test suite grows large.
The behaviour is controlled by command-line options:
--rerunRerun only tests, which failed during the last run. If the last run was successful, execute a full test suite afresh. A shortcut for
--rerun-update--rerun-filter failures,exceptions--rerun-all-on-success.--rerun-updateUpdate the log file to reflect latest test outcomes.
--rerun-filterCATEGORIESRead the log file and rerun only tests from a given comma-separated list of categories:
failures,exceptions,new,successful. If this option is omitted or the log file is missing, rerun everything.--rerun-all-on-successIf according to the log file and
--rerun-filterthere is nothing left to rerun, run all tests. This comes especially handy instack test --file-watchorghcidscenarios.--rerun-log-fileFILELocation of the log file (default:
.tasty-rerun-log).
To add it to your test suite just replace
defaultMain with
defaultMainWithRerun or wrap arguments
of defaultMainWithIngredients
into rerunningTests.
Synopsis
- defaultMainWithRerun :: TestTree -> IO ()
- rerunningTests :: [Ingredient] -> Ingredient
Documentation
defaultMainWithRerun :: TestTree -> IO () Source #
Drop-in replacement for defaultMain.
import Test.Tasty import Test.Tasty.Ingredients.Rerun main :: IO () main = defaultMainWithRerun tests tests :: TestTree tests = undefined
rerunningTests :: [Ingredient] -> Ingredient Source #
Ingredient transformer, to use with
defaultMainWithIngredients.
import Test.Tasty
import Test.Tasty.Runners
import Test.Tasty.Ingredients.Rerun
main :: IO ()
main =
defaultMainWithIngredients
[ rerunningTests [ listingTests, consoleTestReporter ] ]
tests
tests :: TestTree
tests = undefined