packages feed

tasty 0.11.1 → 0.11.2

raw patch · 3 files changed

+26/−1 lines, 3 files

Files

CHANGELOG.md view
@@ -1,6 +1,11 @@ Changes ======= +Version 0.11.2+--------------++Add `composeReporters`, a function to run multiple reporter ingredients+ Version 0.11.1 -------------- 
Test/Tasty/Ingredients.hs view
@@ -8,6 +8,7 @@   , ingredientOptions   , ingredientsOptions   , suiteOptions+  , composeReporters   ) where  import Control.Monad@@ -18,6 +19,7 @@ import Test.Tasty.Run import Test.Tasty.Options import Test.Tasty.Options.Core+import Control.Concurrent.Async (concurrently)  -- | 'Ingredient's make your test suite tasty. --@@ -119,3 +121,21 @@   coreOptions ++   ingredientsOptions ins ++   treeOptions tree++-- | Compose two 'TestReporter' ingredients which are then executed+-- in parallel. This can be useful if you want to have two reporters+-- active at the same time, e.g., one which prints to the console and+-- one which writes the test results to a file.+--+-- Be aware that it is not possible to use 'composeReporters' with a 'TestManager',+-- it only works for 'TestReporter' ingredients.+composeReporters :: Ingredient -> Ingredient -> Ingredient+composeReporters (TestReporter o1 f1) (TestReporter o2 f2) =+  TestReporter (o1 ++ o2) $ \o t ->+  case (f1 o t, f2 o t) of+    (g, Nothing) -> g+    (Nothing, g) -> g+    (Just g1, Just g2) -> Just $ \s -> do+      (h1, h2) <- concurrently (g1 s) (g2 s)+      return $ \x -> fmap (uncurry (&&)) $ concurrently (h1 x) (h2 x)+composeReporters _ _ = error "Only TestReporters can be composed"
tasty.cabal view
@@ -2,7 +2,7 @@ --  see http://haskell.org/cabal/users-guide/  name:                tasty-version:             0.11.1+version:             0.11.2 synopsis:            Modern and extensible testing framework description:         Tasty is a modern testing framework for Haskell.                      It lets you combine your unit tests, golden