summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRomanCheplyaka <>2018-02-13 16:29:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-02-13 16:29:00 (GMT)
commit253e9034eedc1f012fa33feaa908ee20ce2a2c09 (patch)
tree3d8cd020599f1dafa727a1d143263bd6a3eff940
parent306518406638ee533e9f5b6a1e33bc5492296e6a (diff)
version 0.10HEAD0.10master
-rw-r--r--CHANGELOG.md8
-rw-r--r--Test/Tasty/QuickCheck.hs17
-rw-r--r--tasty-quickcheck.cabal7
3 files changed, 27 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 12a69b8..0f0aa4f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,14 @@
Changes
=======
+Version 0.10
+------------
+
+* Do not re-export irrelevant Template Haskell QuickCheck functions
+* Make boolean options case-insensitive
+* Make --quickcheck-show-replay a command-line flag rather than an option
+ requiring an argument `True`
+
Version 0.9.2
-------------
diff --git a/Test/Tasty/QuickCheck.hs b/Test/Tasty/QuickCheck.hs
index 8d7f94c..ea3af48 100644
--- a/Test/Tasty/QuickCheck.hs
+++ b/Test/Tasty/QuickCheck.hs
@@ -36,12 +36,20 @@ import Test.QuickCheck hiding -- for re-export
, verboseCheckWithResult
, verboseCheckResult
, verbose
+ -- Template Haskell functions
+#if MIN_VERSION_QuickCheck(2,11,0)
+ , allProperties
+#endif
+ , forAllProperties
+ , quickCheckAll
+ , verboseCheckAll
)
import Data.Typeable
import Data.List
import Text.Printf
import Test.QuickCheck.Random (mkQCGen)
+import Options.Applicative (metavar)
import System.Random (getStdRandom, randomR)
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative
@@ -92,6 +100,7 @@ instance IsOption QuickCheckTests where
parseValue = fmap QuickCheckTests . safeRead
optionName = return "quickcheck-tests"
optionHelp = return "Number of test cases for QuickCheck to generate"
+ optionCLParser = mkOptionCLParser $ metavar "NUMBER"
instance IsOption QuickCheckReplay where
defaultValue = QuickCheckReplay Nothing
@@ -99,12 +108,14 @@ instance IsOption QuickCheckReplay where
parseValue v = QuickCheckReplay . Just <$> safeRead v
optionName = return "quickcheck-replay"
optionHelp = return "Random seed to use for replaying a previous test run (use same --quickcheck-max-size)"
+ optionCLParser = mkOptionCLParser $ metavar "SEED"
instance IsOption QuickCheckShowReplay where
defaultValue = QuickCheckShowReplay False
- parseValue = fmap QuickCheckShowReplay . safeRead
+ parseValue = fmap QuickCheckShowReplay . safeReadBool
optionName = return "quickcheck-show-replay"
optionHelp = return "Show a replay token for replaying tests"
+ optionCLParser = flagCLParser Nothing (QuickCheckShowReplay True)
defaultMaxSize :: Int
defaultMaxSize = QC.maxSize QC.stdArgs
@@ -114,16 +125,18 @@ instance IsOption QuickCheckMaxSize where
parseValue = fmap QuickCheckMaxSize . safeRead
optionName = return "quickcheck-max-size"
optionHelp = return "Size of the biggest test cases quickcheck generates"
+ optionCLParser = mkOptionCLParser $ metavar "NUMBER"
instance IsOption QuickCheckMaxRatio where
defaultValue = fromIntegral $ QC.maxDiscardRatio QC.stdArgs
parseValue = fmap QuickCheckMaxRatio . safeRead
optionName = return "quickcheck-max-ratio"
optionHelp = return "Maximum number of discared tests per successful test before giving up"
+ optionCLParser = mkOptionCLParser $ metavar "NUMBER"
instance IsOption QuickCheckVerbose where
defaultValue = QuickCheckVerbose False
- parseValue = fmap QuickCheckVerbose . safeRead
+ parseValue = fmap QuickCheckVerbose . safeReadBool
optionName = return "quickcheck-verbose"
optionHelp = return "Show the generated test cases"
optionCLParser = mkFlagCLParser mempty (QuickCheckVerbose True)
diff --git a/tasty-quickcheck.cabal b/tasty-quickcheck.cabal
index ce4cb28..0c19d67 100644
--- a/tasty-quickcheck.cabal
+++ b/tasty-quickcheck.cabal
@@ -2,7 +2,7 @@
-- documentation, see http://haskell.org/cabal/users-guide/
name: tasty-quickcheck
-version: 0.9.2
+version: 0.10
synopsis: QuickCheck support for the Tasty test framework.
description: QuickCheck support for the Tasty test framework.
license: MIT
@@ -26,7 +26,8 @@ library
exposed-modules: Test.Tasty.QuickCheck
-- other-modules:
other-extensions: GeneralizedNewtypeDeriving, DeriveDataTypeable
- build-depends: base == 4.*, tagged, tasty >= 0.10.1, random, QuickCheck >= 2.7
+ build-depends: base == 4.*, tagged, tasty >= 0.10.1, random, QuickCheck >= 2.7,
+ optparse-applicative
-- hs-source-dirs:
default-language: Haskell2010
@@ -45,7 +46,7 @@ test-suite test
test.hs
build-depends:
base >= 4 && < 5
- , tasty >= 0.11.1
+ , tasty >= 1.0.1
, tasty-quickcheck
, tasty-hunit
, pcre-light