packages feed

tasty 0.10.1 → 0.10.1.1

raw patch · 4 files changed

+19/−5 lines, 4 files

Files

CHANGELOG.md view
@@ -1,6 +1,13 @@ Changes ======= +Version 0.10.1.1+----------------++* Prevent parsing non-positive number of threads via program options (#104)+* Buffer output to avoid slowdowns when printing test results (#101)+* Default to using the maximum number of available cores for test execution+ Version 0.10.1 -------------- 
Test/Tasty/Ingredients/ConsoleReporter.hs view
@@ -68,9 +68,10 @@       level <- ask        let-        printTestName =+        printTestName = do           printf "%s%s: %s" (indent level) name             (replicate (alignment - indentSize * level - length name) ' ')+          hFlush stdout          printTestResult result = do           rDesc <- formatMessage $ resultDescription result@@ -293,7 +294,7 @@     then (do hideCursor; k) `finally` showCursor     else k) $ do -      hSetBuffering stdout NoBuffering+      hSetBuffering stdout LineBuffering        let         whenColor = lookupOption opts
Test/Tasty/Options/Core.hs view
@@ -9,11 +9,13 @@   )   where +import Control.Monad (mfilter) import Data.Typeable import Data.Proxy import Data.Tagged import Data.Fixed import Options.Applicative+import GHC.Conc  import Test.Tasty.Options import Test.Tasty.Patterns@@ -28,8 +30,8 @@ newtype NumThreads = NumThreads { getNumThreads :: Int }   deriving (Eq, Ord, Num, Typeable) instance IsOption NumThreads where-  defaultValue = 1-  parseValue = fmap NumThreads . safeRead+  defaultValue = NumThreads numCapabilities+  parseValue = mfilter onlyPositive . fmap NumThreads . safeRead   optionName = return "num-threads"   optionHelp = return "Number of threads to use for tests execution"   optionCLParser =@@ -42,6 +44,10 @@       name = untag (optionName :: Tagged NumThreads String)       parse = str >>=         maybe (readerError $ "Could not parse " ++ name) pure <$> parseValue++-- | Filtering function to prevent non-positive number of threads+onlyPositive :: NumThreads -> Bool+onlyPositive (NumThreads x) = x > 0  -- | Timeout to be applied to individual tests data Timeout
tasty.cabal view
@@ -2,7 +2,7 @@ --  see http://haskell.org/cabal/users-guide/  name:                tasty-version:             0.10.1+version:             0.10.1.1 synopsis:            Modern and extensible testing framework description:         Tasty is a modern testing framework for Haskell.                      It lets you combine your unit tests, golden