on 43dda21 help sign in
streamly/test/streamly-tests.cabal
444 lines 13 kB history raw
1cabal-version: 2.2
2name: streamly-tests
3version: 0.0.0
4synopsis: Tests for streamly
5description: See streamly-benchmarks for the reason why we use a separate
6 package for tests.
8flag fusion-plugin
9 description: Use fusion plugin for benchmarks and executables
10 manual: True
11 default: False
13flag limit-build-mem
14 description: Limits memory when building the executables
15 manual: True
16 default: False
18flag use-large-mem
19 description: Include tests that require large amount of memory
20 manual: True
21 default: False
23flag include-flaky-tests
24 description: Include tests that are unpredictable
25 manual: True
26 default: False
28flag dev
29 description: Development build
30 manual: True
31 default: False
33flag has-llvm
34 description: Use llvm backend for better performance
35 manual: True
36 default: False
38flag opt
39 description: off=-O0 (faster builds), on=-O2
40 manual: True
41 default: True
43-------------------------------------------------------------------------------
44-- Common stanzas
45-------------------------------------------------------------------------------
47common compile-options
48 default-language: Haskell2010
50 if os(darwin)
51 cpp-options: -DCABAL_OS_DARWIN
53 if os(linux)
54 cpp-options: -DCABAL_OS_LINUX
56 if os(windows)
57 cpp-options: -DCABAL_OS_WINDOWS
59 if flag(dev)
60 cpp-options: -DDEVBUILD
62 ghc-options: -Wall
63 -Wcompat
64 -Wunrecognised-warning-flags
65 -Widentities
66 -Wincomplete-record-updates
67 -Wincomplete-uni-patterns
68 -Wredundant-constraints
69 -Wnoncanonical-monad-instances
70 -Wmissing-export-lists
71 -Rghc-timing
73 if flag(has-llvm)
74 ghc-options: -fllvm
76 if flag(dev)
77 ghc-options: -Wmissed-specialisations
78 -Wall-missed-specialisations
80 if flag(limit-build-mem)
81 ghc-options: +RTS -M512M -RTS
83 if flag(use-large-mem)
84 cpp-options: -DUSE_LARGE_MEMORY
86 if flag(include-flaky-tests)
87 cpp-options: -DINCLUDE_FLAKY_TESTS
89common default-extensions
90 default-extensions:
91 BangPatterns
92 CApiFFI
93 CPP
94 ConstraintKinds
95 DeriveDataTypeable
96 DeriveGeneric
97 DeriveTraversable
98 ExistentialQuantification
99 FlexibleContexts
100 FlexibleInstances
101 GeneralizedNewtypeDeriving
102 InstanceSigs
103 KindSignatures
104 LambdaCase
105 MagicHash
106 MultiParamTypeClasses
107 PatternSynonyms
108 RankNTypes
109 RecordWildCards
110 ScopedTypeVariables
111 TupleSections
112 TypeFamilies
113 ViewPatterns
115 -- MonoLocalBinds, enabled by TypeFamilies, causes performance
116 -- regressions. Disable it. This must come after TypeFamilies,
117 -- otherwise TypeFamilies will enable it again.
118 NoMonoLocalBinds
120 -- UndecidableInstances -- Does not show any perf impact
121 -- UnboxedTuples -- interferes with (#.)
123common threading-options
124 ghc-options: -threaded
125 -with-rtsopts=-N
127common optimization-options
128 if flag(opt) || flag(fusion-plugin)
129 ghc-options: -O2
130 -fdicts-strict
131 -fmax-worker-args=16
132 -fspec-constr-recursive=16
133 -- This must come after -O2
134 -fno-ignore-asserts
135 if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
136 ghc-options: -fplugin Fusion.Plugin
137 else
138 ghc-options: -O0
140common test-dependencies
141 build-depends:
142 streamly
143 , streamly-core
144 , base >= 4.9 && < 4.17
145 , containers >= 0.5 && < 0.7
146 , exceptions >= 0.8 && < 0.11
147 , ghc
148 , hspec >= 2.0 && < 2.10
149 , mtl >= 2.2 && < 2.3
150 , random >= 1.0.0 && < 1.3
151 , transformers >= 0.4 && < 0.7
152 , QuickCheck >= 2.13 && < 2.15
153 , directory >= 1.2.2 && < 1.4
154 , filepath >= 1.4.1 && < 1.5
155 , temporary >= 1.3 && < 1.4
156 , network >= 3.1 && < 3.2
158 if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
159 build-depends:
160 fusion-plugin >= 0.2 && < 0.3
162-------------------------------------------------------------------------------
163-- Library
164-------------------------------------------------------------------------------
166common lib-options
167 import: compile-options
168 , optimization-options
169 , default-extensions
170 , test-dependencies
172library
173 import: lib-options, test-dependencies
174 hs-source-dirs: lib
175 exposed-modules: Streamly.Test.Common
176 , Streamly.Test.Prelude.Common
177 if flag(limit-build-mem)
178 ghc-options: +RTS -M1500M -RTS
180-------------------------------------------------------------------------------
181-- Test suite options
182-------------------------------------------------------------------------------
184common test-options
185 import: lib-options
186 , threading-options
187 ghc-options: -rtsopts -fno-ignore-asserts
188 include-dirs: .
189 build-depends: streamly-tests
191common always-optimized
192 import: compile-options
193 , threading-options
194 , default-extensions
195 , test-dependencies
196 ghc-options: -O2
197 -fdicts-strict
198 -fmax-worker-args=16
199 -fspec-constr-recursive=16
200 -rtsopts
201 -fno-ignore-asserts
202 if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
203 ghc-options: -fplugin Fusion.Plugin
205-------------------------------------------------------------------------------
206-- Test suites in sorted order
207-------------------------------------------------------------------------------
209test-suite Data.List
210 import: test-options
211 type: exitcode-stdio-1.0
212 main-is: Streamly/Test/Data/List.hs
213 cpp-options: -DUSE_STREAMLY_LIST
215test-suite Data.List.Base
216 import: test-options
217 type: exitcode-stdio-1.0
218 main-is: Streamly/Test/Data/List.hs
220test-suite Data.Array
221 import: test-options
222 type: exitcode-stdio-1.0
223 main-is: Streamly/Test/Data/Array.hs
224 ghc-options: -main-is Streamly.Test.Data.Array.main
226test-suite Data.Array.Prim
227 import: test-options
228 type: exitcode-stdio-1.0
229 main-is: Streamly/Test/Data/Array/Prim.hs
230 ghc-options: -main-is Streamly.Test.Data.Array.Prim.main
232test-suite Data.Array.Prim.Pinned
233 import: test-options
234 type: exitcode-stdio-1.0
235 main-is: Streamly/Test/Data/Array/Prim/Pinned.hs
236 ghc-options: -main-is Streamly.Test.Data.Array.Prim.Pinned.main
238test-suite Data.Array.Foreign
239 import: test-options
240 type: exitcode-stdio-1.0
241 main-is: Streamly/Test/Data/Array/Foreign.hs
242 ghc-options: -main-is Streamly.Test.Data.Array.Foreign.main
244test-suite Data.Array.Stream.Foreign
245 import: test-options
246 type: exitcode-stdio-1.0
247 main-is: Streamly/Test/Data/Array/Stream/Foreign.hs
249test-suite Data.Fold
250 import: test-options
251 type: exitcode-stdio-1.0
252 main-is: Streamly/Test/Data/Fold.hs
254test-suite Data.Fold.Window
255 import: test-options
256 type: exitcode-stdio-1.0
257 main-is: Streamly/Test/Data/Fold/Window.hs
258 ghc-options: -main-is Streamly.Test.Data.Fold.Window.main
260test-suite Data.Parser
261 import: test-options
262 type: exitcode-stdio-1.0
263 main-is: Streamly/Test/Data/Parser.hs
264 if flag(limit-build-mem)
265 ghc-options: +RTS -M1000M -RTS
267test-suite Data.Parser.ParserD
268 import: test-options
269 type: exitcode-stdio-1.0
270 main-is: Streamly/Test/Data/Parser/ParserD.hs
271 if flag(limit-build-mem)
272 ghc-options: +RTS -M1000M -RTS
274test-suite Data.SmallArray
275 import: test-options
276 type: exitcode-stdio-1.0
277 main-is: Streamly/Test/Data/SmallArray.hs
278 ghc-options: -main-is Streamly.Test.Data.SmallArray.main
280test-suite Data.Unfold
281 import: test-options
282 type: exitcode-stdio-1.0
283 main-is: Streamly/Test/Data/Unfold.hs
285test-suite FileSystem.Event
286 import: test-options
287 type: exitcode-stdio-1.0
288 ghc-options: -main-is Streamly.Test.FileSystem.Event
289 main-is: Streamly/Test/FileSystem/Event.hs
290 other-modules: Streamly.Test.FileSystem.Event.Common
292test-suite FileSystem.Event.Darwin
293 import: test-options
294 type: exitcode-stdio-1.0
295 main-is: Streamly/Test/FileSystem/Event/Darwin.hs
296 other-modules: Streamly.Test.FileSystem.Event.Common
297 cpp-options: -DFILESYSTEM_EVENT_DARWIN
298 ghc-options: -main-is Streamly.Test.FileSystem.Event.Darwin
299 if !os(darwin)
300 buildable: False
302test-suite FileSystem.Event.Linux
303 import: test-options
304 type: exitcode-stdio-1.0
305 main-is: Streamly/Test/FileSystem/Event/Linux.hs
306 other-modules: Streamly.Test.FileSystem.Event.Common
307 cpp-options: -DFILESYSTEM_EVENT_LINUX
308 ghc-options: -main-is Streamly.Test.FileSystem.Event.Linux
309 if !os(linux)
310 buildable: False
312test-suite FileSystem.Event.Windows
313 import: test-options
314 type: exitcode-stdio-1.0
315 main-is: Streamly/Test/FileSystem/Event/Windows.hs
316 other-modules: Streamly.Test.FileSystem.Event.Common
317 cpp-options: -DFILESYSTEM_EVENT_WINDOWS
318 ghc-options: -main-is Streamly.Test.FileSystem.Event.Windows
319 if !os(windows)
320 buildable: False
322test-suite FileSystem.Handle
323 import: test-options
324 type: exitcode-stdio-1.0
325 main-is: Streamly/Test/FileSystem/Handle.hs
326 ghc-options: -main-is Streamly.Test.FileSystem.Handle.main
328test-suite Network.Inet.TCP
329 import: test-options
330 type: exitcode-stdio-1.0
331 main-is: Streamly/Test/Network/Inet/TCP.hs
333test-suite Network.Socket
334 import: test-options
335 type: exitcode-stdio-1.0
336 main-is: Streamly/Test/Network/Socket.hs
338test-suite Prelude
339 import: test-options
340 type: exitcode-stdio-1.0
341 main-is: Streamly/Test/Prelude.hs
342 ghc-options: -main-is Streamly.Test.Prelude.main
344test-suite Prelude.Ahead
345 import: test-options
346 type: exitcode-stdio-1.0
347 main-is: Streamly/Test/Prelude/Ahead.hs
348 ghc-options: -main-is Streamly.Test.Prelude.Ahead.main
350test-suite Prelude.Async
351 import: test-options
352 type: exitcode-stdio-1.0
353 main-is: Streamly/Test/Prelude/Async.hs
354 ghc-options: -main-is Streamly.Test.Prelude.Async.main
356test-suite Prelude.Concurrent
357 import: test-options
358 type: exitcode-stdio-1.0
359 main-is: Streamly/Test/Prelude/Concurrent.hs
360 ghc-options: -main-is Streamly.Test.Prelude.Concurrent.main
361 if flag(limit-build-mem)
362 ghc-options: +RTS -M2000M -RTS
364test-suite Prelude.Fold
365 import: test-options
366 type: exitcode-stdio-1.0
367 main-is: Streamly/Test/Prelude/Fold.hs
368 ghc-options: -main-is Streamly.Test.Prelude.Fold.main
370test-suite Prelude.Parallel
371 import: test-options
372 type: exitcode-stdio-1.0
373 main-is: Streamly/Test/Prelude/Parallel.hs
374 ghc-options: -main-is Streamly.Test.Prelude.Parallel.main
376test-suite Prelude.Rate
377 import:always-optimized
378 type: exitcode-stdio-1.0
379 main-is: Streamly/Test/Prelude/Rate.hs
380 ghc-options: -main-is Streamly.Test.Prelude.Rate.main
381 if flag(dev)
382 buildable: True
383 else
384 buildable: False
386test-suite Prelude.Serial
387 import: test-options
388 type: exitcode-stdio-1.0
389 main-is: Streamly/Test/Prelude/Serial.hs
390 ghc-options: -main-is Streamly.Test.Prelude.Serial.main
391 if flag(limit-build-mem)
392 ghc-options: +RTS -M1500M -RTS
394test-suite Prelude.Top
395 import: test-options
396 type: exitcode-stdio-1.0
397 main-is: Streamly/Test/Prelude/Top.hs
399test-suite Prelude.WAsync
400 import: test-options
401 type: exitcode-stdio-1.0
402 main-is: Streamly/Test/Prelude/WAsync.hs
403 ghc-options: -main-is Streamly.Test.Prelude.WAsync.main
405test-suite Prelude.WSerial
406 import: test-options
407 type: exitcode-stdio-1.0
408 main-is: Streamly/Test/Prelude/WSerial.hs
409 ghc-options: -main-is Streamly.Test.Prelude.WSerial.main
411test-suite Prelude.ZipAsync
412 import: test-options
413 type: exitcode-stdio-1.0
414 main-is: Streamly/Test/Prelude/ZipAsync.hs
415 ghc-options: -main-is Streamly.Test.Prelude.ZipAsync.main
416 if flag(limit-build-mem)
417 ghc-options: +RTS -M750M -RTS
419test-suite Prelude.ZipSerial
420 import: test-options
421 type: exitcode-stdio-1.0
422 main-is: Streamly/Test/Prelude/ZipSerial.hs
423 ghc-options: -main-is Streamly.Test.Prelude.ZipSerial.main
425test-suite Unicode.Stream
426 import: test-options
427 type: exitcode-stdio-1.0
428 main-is: Streamly/Test/Unicode/Stream.hs
429 ghc-options: -main-is Streamly.Test.Unicode.Stream.main
431test-suite Unicode.Char
432 import: test-options
433 type: exitcode-stdio-1.0
434 main-is: Streamly/Test/Unicode/Char.hs
435 ghc-options: -main-is Streamly.Test.Unicode.Char.main
436 if flag(dev)
437 buildable: True
438 else
439 buildable: False
441test-suite version-bounds
442 import: test-options
443 type: exitcode-stdio-1.0
444 main-is: version-bounds.hs