on master help sign in
move tests over to the cabal testing framework
8917b68Antoine Latter
tests/BenchUUID.hs+2−10
@@ -1,4 +1,4 @@
1−import Control.Parallel.Strategies
1+import Control.DeepSeq
2import Criterion.Main
2import Criterion.Main
3import Data.Char (ord)
3import Data.Char (ord)
4import Data.IORef
4import Data.IORef
@@ -7,7 +7,7 @@ import Data.Word
7import qualified Data.Set as Set
7import qualified Data.Set as Set
8import qualified Data.ByteString.Lazy as BL
8import qualified Data.ByteString.Lazy as BL
9import qualified Data.ByteString.Lazy.Internal as BL
9import qualified Data.ByteString.Lazy.Internal as BL
10−import qualified Data.UUID.Internal as U
10+import qualified Data.UUID as U
11import qualified Data.UUID.V1 as U
11import qualified Data.UUID.V1 as U
12import qualified Data.UUID.V3 as U3
12import qualified Data.UUID.V3 as U3
13import qualified Data.UUID.V5 as U5
13import qualified Data.UUID.V5 as U5
@@ -123,11 +123,3 @@ uuids
123 "2a0e2efb-a11c-4a44-81ee-3efc37379b48"
123 "2a0e2efb-a11c-4a44-81ee-3efc37379b48"
124 ]
124 ]
125
125
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
8
8
9Category: Data
9Category: Data
10Build-Type: Simple
10Build-Type: Simple
11−Cabal-Version: >= 1.6
11+Cabal-Version: >= 1.8
12
12
13Description:
13Description:
14 This library is useful for creating, comparing, parsing and
14 This library is useful for creating, comparing, parsing and
@@ -24,9 +24,6 @@ Extra-Source-Files:
24 CHANGES
24 CHANGES
25 CONTRIBUTORS
25 CONTRIBUTORS
26
26
27−Flag test
28− Description: Build unit test and benchmark programs.
29− Default: False
30
27
31Library
28Library
32 Build-Depends: random, binary, bytestring, Crypto, maccatcher,
29 Build-Depends: random, binary, bytestring, Crypto, maccatcher,
@@ -48,32 +45,21 @@ Library
48 Ghc-Shared-Options:
45 Ghc-Shared-Options:
49 Ghc-Options: -Wall
46 Ghc-Options: -Wall
50
47
51−Executable benchuuid
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
52+ Main-is: BenchUUID.hs
53− HS-Source-Dirs: tests .
53+ Hs-source-dirs: tests
54− Extensions: DeriveDataTypeable, CPP
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
55+ Build-depends: base == 4.*, uuid, random, criterion >= 0.4 && < 0.6, mersenne-random-pure64,
61− Else
56+ bytestring == 0.9.*, containers == 0.4.*, deepseq == 1.1.*
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
79
57
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