diff options
-rw-r--r-- | bittorrent.cabal | 15 | ||||
-rw-r--r-- | src/Data/Bitfield.hs | 8 |
2 files changed, 19 insertions, 4 deletions
diff --git a/bittorrent.cabal b/bittorrent.cabal index e3d98e84..138f5d3b 100644 --- a/bittorrent.cabal +++ b/bittorrent.cabal | |||
@@ -24,6 +24,9 @@ source-repository head | |||
24 | type: git | 24 | type: git |
25 | location: git://github.com/pxqr/bittorrent.git | 25 | location: git://github.com/pxqr/bittorrent.git |
26 | 26 | ||
27 | flag testing | ||
28 | description: Expose debug stuff in export declarations. | ||
29 | default: False | ||
27 | 30 | ||
28 | library | 31 | library |
29 | exposed-modules: Data.Torrent | 32 | exposed-modules: Data.Torrent |
@@ -79,9 +82,12 @@ library | |||
79 | 82 | ||
80 | extensions: PatternGuards | 83 | extensions: PatternGuards |
81 | hs-source-dirs: src | 84 | hs-source-dirs: src |
85 | if flag(testing) | ||
86 | cpp-options: -DTESTING | ||
82 | ghc-options: -Wall | 87 | ghc-options: -Wall |
83 | 88 | ||
84 | 89 | ||
90 | |||
85 | test-suite info-hash | 91 | test-suite info-hash |
86 | type: exitcode-stdio-1.0 | 92 | type: exitcode-stdio-1.0 |
87 | main-is: info-hash.hs | 93 | main-is: info-hash.hs |
@@ -96,6 +102,9 @@ test-suite info-hash | |||
96 | 102 | ||
97 | ghc-options: -Wall | 103 | ghc-options: -Wall |
98 | 104 | ||
105 | if !flag(testing) | ||
106 | buildable: False | ||
107 | |||
99 | 108 | ||
100 | 109 | ||
101 | test-suite properties | 110 | test-suite properties |
@@ -119,6 +128,9 @@ test-suite properties | |||
119 | 128 | ||
120 | ghc-options: -Wall -fno-warn-orphans | 129 | ghc-options: -Wall -fno-warn-orphans |
121 | 130 | ||
131 | if !flag(testing) | ||
132 | buildable: False | ||
133 | |||
122 | 134 | ||
123 | 135 | ||
124 | benchmark benchmarks | 136 | benchmark benchmarks |
@@ -137,3 +149,6 @@ benchmark benchmarks | |||
137 | , bittorrent | 149 | , bittorrent |
138 | 150 | ||
139 | ghc-options: -O2 -Wall -fno-warn-orphans | 151 | ghc-options: -O2 -Wall -fno-warn-orphans |
152 | |||
153 | if !flag(testing) | ||
154 | buildable: False \ No newline at end of file | ||
diff --git a/src/Data/Bitfield.hs b/src/Data/Bitfield.hs index a1033ff2..ee0570e7 100644 --- a/src/Data/Bitfield.hs +++ b/src/Data/Bitfield.hs | |||
@@ -34,10 +34,10 @@ module Data.Bitfield | |||
34 | , getBitfield, putBitfield | 34 | , getBitfield, putBitfield |
35 | , bitfieldByteCount | 35 | , bitfieldByteCount |
36 | 36 | ||
37 | -- #ifdef TESTING | 37 | #if defined (TESTING) |
38 | , -- * Debug | 38 | -- * Debug |
39 | mkBitfield | 39 | , mkBitfield |
40 | -- #endif | 40 | #endif |
41 | ) where | 41 | ) where |
42 | 42 | ||
43 | import Control.Monad | 43 | import Control.Monad |