packages feed

tasty-rerun 1.1.16 → 1.1.17

raw patch · 4 files changed

+81/−49 lines, 4 filesdep ~basedep ~tasty

Dependency ranges changed: base, tasty

Files

Changelog.md view
@@ -1,3 +1,8 @@+# 1.1.17++* Add `defaultMainWithRerun`,+  a drop-in replacement for `defaultMain`.+ # 1.1.16  * New command-line option `--rerun-all-on-success`.
README.md view
@@ -20,18 +20,15 @@   (e. g., an external service is temporarily down), but you want be sure   that you are not breaking anything else in course of your work. -Add it to your test suite as follows:+To add it to your test suite just replace `Test.Tasty.defaultMain`+with `Test.Tasty.Ingredients.Rerun.defaultMainWithRerun`:  ```haskell import Test.Tasty-import Test.Tasty.Runners import Test.Tasty.Ingredients.Rerun  main :: IO ()-main =-  defaultMainWithIngredients-    [ rerunningTests [ listingTests, consoleTestReporter ] ]-    tests+main = defaultMainWithRerun tests  tests :: TestTree tests = undefined@@ -68,4 +65,3 @@ * `--rerun-log-file FILE`    Location of the log file (default: `.tasty-rerun-log`).-```
src/Test/Tasty/Ingredients/Rerun.hs view
@@ -1,7 +1,61 @@+-- |+-- Module:      Test.Tasty.Ingredients.Rerun+-- Copyright:   Oliver Charles (c) 2014, Andrew Lelechenko (c) 2019+-- Licence:     BSD3+--+-- This ingredient+-- for <https://hackage.haskell.org/package/tasty 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 'Tasty.defaultMainWithIngredients'+-- into 'rerunningTests'.+ {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleContexts #-}-module Test.Tasty.Ingredients.Rerun (rerunningTests) where +module Test.Tasty.Ingredients.Rerun+  ( defaultMainWithRerun+  , rerunningTests+  ) where+ import Prelude hiding (filter)  import Control.Applicative@@ -108,47 +162,24 @@   ----------------------------------------------------------------------------------- |--- This ingredient--- for <https://hackage.haskell.org/package/tasty 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@).++-- | Drop-in replacement for 'Tasty.defaultMain'. ----- Usage example:+-- > import Test.Tasty+-- > import Test.Tasty.Ingredients.Rerun+-- >+-- > main :: IO ()+-- > main = defaultMainWithRerun tests+-- >+-- > tests :: TestTree+-- > tests = undefined+defaultMainWithRerun :: Tasty.TestTree -> IO ()+defaultMainWithRerun =+  Tasty.defaultMainWithIngredients+    [ rerunningTests [ Tasty.listingTests, Tasty.consoleTestReporter ] ]++-- | Ingredient transformer, to use with+-- 'Tasty.defaultMainWithIngredients'. -- -- > import Test.Tasty -- > import Test.Tasty.Runners
tasty-rerun.cabal view
@@ -1,5 +1,5 @@ name:                tasty-rerun-version:             1.1.16+version:             1.1.17 homepage:            http://github.com/ocharles/tasty-rerun license:             BSD3 license-file:        LICENSE