aboutsummaryrefslogtreecommitdiff
path: root/devel/hs-testpack
diff options
context:
space:
mode:
authorGabor Pali <pgj@FreeBSD.org>2013-06-04 18:53:40 +0000
committerGabor Pali <pgj@FreeBSD.org>2013-06-04 18:53:40 +0000
commit109269205e521bb1d2d87678a391e5adefff88d6 (patch)
tree93f1f9278a9a48902904b7ff4a5ce711c10efe08 /devel/hs-testpack
parentad7295cafd0e46ece6fcbf594ef39a767c296d0e (diff)
downloadports-109269205e521bb1d2d87678a391e5adefff88d6.tar.gz
ports-109269205e521bb1d2d87678a391e5adefff88d6.zip
Notes
Diffstat (limited to 'devel/hs-testpack')
-rw-r--r--devel/hs-testpack/Makefile4
-rw-r--r--devel/hs-testpack/files/patch-src__Test__HUnit__Tools.hs56
-rw-r--r--devel/hs-testpack/files/patch-src__Test__QuickCheck__Tools.hs22
-rw-r--r--devel/hs-testpack/files/patch-testpack.cabal4
4 files changed, 77 insertions, 9 deletions
diff --git a/devel/hs-testpack/Makefile b/devel/hs-testpack/Makefile
index 8457e7319b3c..e83fa58c96cf 100644
--- a/devel/hs-testpack/Makefile
+++ b/devel/hs-testpack/Makefile
@@ -3,15 +3,13 @@
PORTNAME= testpack
PORTVERSION= 2.1.2.1
+PORTREVISION= 1
CATEGORIES= devel haskell
MAINTAINER= haskell@FreeBSD.org
COMMENT= Test Utility Pack for HUnit and QuickCheck
LICENSE= LGPL21
-FILE_LICENSE= COPYRIGHT
-
-CABAL_SETUP= Setup.hs
USE_CABAL= HUnit mtl QuickCheck>=2.1.0.3 random
diff --git a/devel/hs-testpack/files/patch-src__Test__HUnit__Tools.hs b/devel/hs-testpack/files/patch-src__Test__HUnit__Tools.hs
index 3bb1c4fa0204..c0bab41941e2 100644
--- a/devel/hs-testpack/files/patch-src__Test__HUnit__Tools.hs
+++ b/devel/hs-testpack/files/patch-src__Test__HUnit__Tools.hs
@@ -1,6 +1,18 @@
---- ./src/Test/HUnit/Tools.hs.orig 2012-02-28 23:20:32.000000000 +0100
-+++ ./src/Test/HUnit/Tools.hs 2012-10-04 00:04:08.000000000 +0200
-@@ -128,7 +128,11 @@
+--- ./src/Test/HUnit/Tools.hs.orig 2013-02-25 16:03:46.000000000 +0100
++++ ./src/Test/HUnit/Tools.hs 2013-05-04 00:47:19.298796917 +0200
+@@ -22,7 +22,11 @@
+ import Test.QuickCheck.Gen
+ import Test.QuickCheck.State
+ import qualified Test.QuickCheck.Property as P
++#if MIN_VERSION_QuickCheck(2,6,0)
++import Test.QuickCheck.Property hiding (Result(reason), interrupted)
++#else
+ import Test.QuickCheck.Property hiding (Result(reason))
++#endif
+ import qualified Control.Exception
+ import qualified Test.HUnit as HU
+ import System.Random
+@@ -128,7 +132,11 @@
> q "Integer -> Int (safe bounds)" prop_integer_to_int_pass]
-}
qc2hu :: QC.Testable a => Int -> String -> a -> HU.Test
@@ -12,7 +24,23 @@
{- | Run verbose tests. Example:
-@@ -174,7 +178,11 @@
+@@ -163,18 +171,26 @@
+ -- | Tests a property, using test arguments, produces a test result, and prints the results to 'stdout'.
+ localquickCheckWithResult :: Testable prop => Args -> prop -> IO Result
+ localquickCheckWithResult args p =
+- do
++#if MIN_VERSION_QuickCheck(2,6,0)
++ (if chatty args then withStdioTerminal else withNullTerminal) $ \tm -> do
++#else
++ do
+ #if MIN_VERSION_QuickCheck(2,3,0)
+ tm <- if chatty args then newStdioTerminal else newNullTerminal
+ #else
+ tm <- newTerminal
+ #endif
++#endif
+ rnd <- case replay args of
+ Nothing -> newStdGen
Just (rnd,_) -> return rnd
test MkState{ terminal = tm
, maxSuccessTests = maxSuccess args
@@ -24,3 +52,23 @@
, computeSize = case replay args of
Nothing -> \n d -> (n * maxSize args)
`div` maxSuccess args
+@@ -190,6 +206,10 @@
+ #endif
+ , numSuccessShrinks = 0
+ , numTryShrinks = 0
++#if MIN_VERSION_QuickCheck(2,6,0)
++ , numRecentlyDiscardedTests = 0
++ , numTotTryShrinks = 0
++#endif
+ } (unGen (property p))
+ where
+ --------------------------------------------------------------------------
+@@ -288,5 +308,8 @@
+ , numShrinks = numShrinks
+ , output = theOutput
+ #endif
++#if MIN_VERSION_QuickCheck(2,6,0)
++ , interrupted = False
++#endif
+ }
+ where (rnd1,rnd2) = split (randomSeed st)
diff --git a/devel/hs-testpack/files/patch-src__Test__QuickCheck__Tools.hs b/devel/hs-testpack/files/patch-src__Test__QuickCheck__Tools.hs
new file mode 100644
index 000000000000..446d7dfc5e98
--- /dev/null
+++ b/devel/hs-testpack/files/patch-src__Test__QuickCheck__Tools.hs
@@ -0,0 +1,22 @@
+--- ./src/Test/QuickCheck/Tools.hs.orig 2013-02-25 16:03:46.000000000 +0100
++++ ./src/Test/QuickCheck/Tools.hs 2013-05-04 00:42:02.274698941 +0200
+@@ -23,14 +23,18 @@
+
+ )
+ where
++#if MIN_VERSION_QuickCheck(2,6,0)
++import Test.QuickCheck hiding (Result, reason, interrupted)
++#else
+ import Test.QuickCheck hiding (Result, reason)
++#endif
+ import Test.QuickCheck.Property
+
+ {- | Compare two values. If same, the test passes. If different, the result indicates
+ what was expected and what was received as part of the error. -}
+ (@=?) :: (Eq a, Show a) => a -> a -> Result
+ expected @=? actual =
+- MkResult {ok = Just (expected == actual),
++ result { ok = Just (expected == actual),
+ expect = True, interrupted = False,
+ reason = "Result: expected " ++ show expected ++ ", got " ++ show actual,
+ stamp = [], callbacks = []}
diff --git a/devel/hs-testpack/files/patch-testpack.cabal b/devel/hs-testpack/files/patch-testpack.cabal
index f349491c00c9..ad3736aabe80 100644
--- a/devel/hs-testpack/files/patch-testpack.cabal
+++ b/devel/hs-testpack/files/patch-testpack.cabal
@@ -1,11 +1,11 @@
--- ./testpack.cabal.orig 2013-02-25 16:03:46.000000000 +0100
-+++ ./testpack.cabal 2013-03-09 17:54:39.000000000 +0100
++++ ./testpack.cabal 2013-05-04 00:08:00.417315359 +0200
@@ -39,7 +39,7 @@
Build-Depends: base >= 3 && < 5,
mtl, HUnit,
- QuickCheck >= 2.1.0.3 && < 2.5
-+ QuickCheck >= 2.1.0.3 && < 2.6
++ QuickCheck >= 2.1.0.3 && < 2.7
If flag(splitBase)
Build-Depends: base >= 3 && < 5, containers, random