on master help sign in
move tests over to the cabal testing framework
commit8917b68396454d89012d7b85b65dc52c07bbb1ed authorAntoine Latter <aslatter@gmail.com> dateThu 11 Aug 2011, 00:34 (15 years ago) parentefa8fa8
2 files changed+20−42
tests/BenchUUID.hs+2−10 uuid.cabal+18−32
tests/BenchUUID.hs+2−10
@@ -1,4 +1,4 @@
1−import Control.Parallel.Strategies
1+import Control.DeepSeq
22import Criterion.Main
33import Data.Char (ord)
44import Data.IORef
@@ -7,7 +7,7 @@ import Data.Word
77import qualified Data.Set as Set
88import qualified Data.ByteString.Lazy as BL
99import qualified Data.ByteString.Lazy.Internal as BL
10−import qualified Data.UUID.Internal as U
10+import qualified Data.UUID as U
1111import qualified Data.UUID.V1 as U
1212import qualified Data.UUID.V3 as U3
1313import qualified Data.UUID.V5 as U5
@@ -123,11 +123,3 @@ uuids
123123 "2a0e2efb-a11c-4a44-81ee-3efc37379b48"
124124 ]
125125
126−#if !(MIN_VERSION_criterion(0,4,0))
127−nf f arg = B ( rnf . f) arg
128−whnf f arg = B f arg
129−#endif
130−
131−#if !(MIN_VERSION_criterion(0,4,1))
132−nfIO act = rnf `fmap` act
133−#endif
uuid.cabal+18−32
@@ -8,7 +8,7 @@ License-file: LICENSE
88
99Category: Data
1010Build-Type: Simple
11−Cabal-Version: >= 1.6
11+Cabal-Version: >= 1.8
1212
1313Description:
1414 This library is useful for creating, comparing, parsing and
@@ -24,9 +24,6 @@ Extra-Source-Files:
2424 CHANGES
2525 CONTRIBUTORS
2626
27−Flag test
28− Description: Build unit test and benchmark programs.
29− Default: False
3027
3128Library
3229 Build-Depends: random, binary, bytestring, Crypto, maccatcher,
@@ -48,32 +45,21 @@ Library
4845 Ghc-Shared-Options:
4946 Ghc-Options: -Wall
5047
51−Executable benchuuid
52− Main-Is: BenchUUID.hs
53− HS-Source-Dirs: tests .
54− Extensions: DeriveDataTypeable, CPP
55− If flag(test)
56− Buildable: True
57− Build-Depends: random, binary, bytestring, Crypto, maccatcher,
58− time, base >=3, base < 5, containers,
59− criterion >= 0.3 && < 0.5, parallel >= 2.1 && < 2.3,
60− mersenne-random-pure64 >= 0.2 && < 0.3
61− Else
62− Buildable: False
63−
64−Executable testuuid
65− Main-Is: TestUUID.hs
66− HS-Source-Dirs: tests .
67− Extensions: DeriveDataTypeable
68− Ghc-Prof-Options: -auto-all -caf-all
69− Ghc-Shared-Options:
70− Ghc-Options: -Wall -fno-warn-orphans
71−
72− If flag(test)
73− Buildable: True
74− Build-Depends: random, binary, bytestring, Crypto, maccatcher,
75− time, base >=3, base < 5,
76− HUnit >=1.2 && < 1.3, QuickCheck >=1.2 && < 1.3
77− Else
78− Buildable: False
48+-- not strictly a test, but we want it to error if
49+-- it can't build
50+Test-Suite benchmark
51+ Type: exitcode-stdio-1.0
52+ Main-is: BenchUUID.hs
53+ Hs-source-dirs: tests
54+ Extensions: DeriveDataTypeable, CPP
55+ Build-depends: base == 4.*, uuid, random, criterion >= 0.4 && < 0.6, mersenne-random-pure64,
56+ bytestring == 0.9.*, containers == 0.4.*, deepseq == 1.1.*
7957
58+Test-Suite testuuid
59+ Type: exitcode-stdio-1.0
60+ Main-is: TestUUID.hs
61+ Hs-source-dirs: tests
62+ Extensions: DeriveDataTypeable
63+ Ghc-Options: -Wall -fno-warn-orphans
64+ Build-Depends: random, bytestring, base >=3, base < 5, uuid,
65+ HUnit >=1.2 && < 1.3, QuickCheck >=1.2 && < 1.3