diff options
author | Sam T <pxqr.sta@gmail.com> | 2013-06-07 01:09:37 +0400 |
---|---|---|
committer | Sam T <pxqr.sta@gmail.com> | 2013-06-07 01:09:37 +0400 |
commit | 558616b7dcc8955ab08fe8b194cdd5e128aba3f4 (patch) | |
tree | 71a7c54f5f3c83bc2847c8efabf3b966e0f0800c /bittorrent.cabal | |
parent | 65282d73004fb45b502a5e9bf50359159f6179de (diff) |
~ Use testing flag to hide internals.
We need some internal functions in tests and benchmarks, so it's better
to just use CPP for this.
Diffstat (limited to 'bittorrent.cabal')
-rw-r--r-- | bittorrent.cabal | 15 |
1 files changed, 15 insertions, 0 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 | ||