Drop-in replacement for Tasty.defaultMain.
import Test.Tasty
import Test.Tasty.Ingredients.Rerun
main :: IO ()
main = defaultMainWithRerun tests
tests :: TestTree
tests = undefined:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27
Moduletasty-rerun-1.1.19Haskell2010
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:
--rerun
Rerun 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-update
Update the log file to reflect latest test outcomes.
--rerun-filter CATEGORIES
Read 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-success
If according to the log file and --rerun-filter there
is nothing left to rerun, run all tests. This comes
especially handy in stack test --file-watch or
ghcid scenarios.
--rerun-log-file FILE
Location of the log file (default: .tasty-rerun-log).
To add it to your test suite just replace
Tasty.defaultMain with
defaultMainWithRerun or wrap arguments
of defaultMainWithIngredients
into rerunningTests.
Drop-in replacement for Tasty.defaultMain.
import Test.Tasty
import Test.Tasty.Ingredients.Rerun
main :: IO ()
main = defaultMainWithRerun tests
tests :: TestTree
tests = undefinedIngredient 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