tasty-rerun 1.0.0 → 1.0.1
raw patch · 3 files changed
+21/−5 lines, 3 files
Files
- Changelog.md +4/−0
- src/Test/Tasty/Ingredients/Rerun.hs +16/−4
- tasty-rerun.cabal +1/−1
Changelog.md view
@@ -1,3 +1,7 @@+# 1.0.1++* Now supports filtering `TestTree`s that use resources.+ # 1.0.0 * Initial release. Supports the `--rerun-update`, `--rerun-log-file` and
src/Test/Tasty/Ingredients/Rerun.hs view
@@ -5,15 +5,16 @@ import Control.Applicative import Control.Arrow ((>>>))+import Control.Exception (throwIO) import Control.Monad (guard, when) import Control.Monad.Trans.Class (lift) import Data.Char (isSpace) import Data.Foldable (asum)+import Data.List.Split (endBy) import Data.Maybe (fromMaybe) import Data.Monoid (mconcat) import Data.Proxy (Proxy(..)) import Data.Semigroup.Applicative (Traversal(..))-import Data.List.Split (endBy) import Data.Tagged (Tagged(..), untag) import Data.Typeable (Typeable) import System.IO.Error (catchIOError, isDoesNotExistError)@@ -27,6 +28,7 @@ import qualified Options.Applicative as OptParse import qualified Test.Tasty as Tasty import qualified Test.Tasty.Options as Tasty+import qualified Test.Tasty.Providers as Tasty import qualified Test.Tasty.Runners as Tasty --------------------------------------------------------------------------------@@ -181,9 +183,19 @@ foldGroup name tests = \prefix -> [ Tasty.testGroup name (tests (prefix ++ [name])) ] - treeFold = Tasty.trivialFold { Tasty.foldSingle = foldSingle- , Tasty.foldGroup = foldGroup- }+ foldResource rSpec k = \prefix ->+ let peek = k (error "Resources unavailable during test tree filtering")+ in case peek prefix of+ [x] -> [ Tasty.WithResource rSpec (\io -> head $ k io prefix) ]+ [] -> []+ _ -> error "Resource claims to initialize multiple tests. \+ \Please report this as a bug."++ treeFold = Tasty.TreeFold { Tasty.foldSingle = foldSingle+ , Tasty.foldGroup = foldGroup+ , Tasty.foldResource = foldResource+ }+ in case Tasty.foldTestTree treeFold options testTree [] of [t] -> Just t [] -> Nothing
tasty-rerun.cabal view
@@ -1,5 +1,5 @@ name: tasty-rerun-version: 1.0.0+version: 1.0.1 homepage: http://github.com/ocharles/tasty-rerun license: BSD3 license-file: LICENSE