on 8290458 help sign in
streamly/test/streamly-tests.cabal
593 lines 17 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
43flag use-streamly-core
44 description: Test only core package
45 manual: True
46 default: False
48-------------------------------------------------------------------------------
49-- Common stanzas
50-------------------------------------------------------------------------------
52common compile-options
53 default-language: Haskell2010
55 if os(darwin)
56 cpp-options: -DCABAL_OS_DARWIN
58 if os(linux)
59 cpp-options: -DCABAL_OS_LINUX
61 if os(windows)
62 cpp-options: -DCABAL_OS_WINDOWS
64 if flag(dev)
65 cpp-options: -DDEVBUILD
67 ghc-options: -Wall
68 -Wcompat
69 -Wunrecognised-warning-flags
70 -Widentities
71 -Wincomplete-record-updates
72 -Wincomplete-uni-patterns
73 -Wredundant-constraints
74 -Wnoncanonical-monad-instances
75 -Wmissing-export-lists
76 -Rghc-timing
78 if flag(has-llvm)
79 ghc-options: -fllvm
81 if flag(dev)
82 ghc-options: -Wmissed-specialisations
83 -Wall-missed-specialisations
85 if flag(limit-build-mem)
86 ghc-options: +RTS -M512M -RTS
88 if flag(use-large-mem)
89 cpp-options: -DUSE_LARGE_MEMORY
91 if flag(include-flaky-tests)
92 cpp-options: -DINCLUDE_FLAKY_TESTS
94common default-extensions
95 default-extensions:
96 BangPatterns
97 CApiFFI
98 CPP
99 ConstraintKinds
100 DeriveDataTypeable
101 DeriveGeneric
102 DeriveTraversable
103 ExistentialQuantification
104 FlexibleContexts
105 FlexibleInstances
106 GeneralizedNewtypeDeriving
107 InstanceSigs
108 KindSignatures
109 LambdaCase
110 MagicHash
111 MultiParamTypeClasses
112 PatternSynonyms
113 RankNTypes
114 RecordWildCards
115 ScopedTypeVariables
116 TupleSections
117 TypeFamilies
118 ViewPatterns
120 -- MonoLocalBinds, enabled by TypeFamilies, causes performance
121 -- regressions. Disable it. This must come after TypeFamilies,
122 -- otherwise TypeFamilies will enable it again.
123 NoMonoLocalBinds
125 -- UndecidableInstances -- Does not show any perf impact
126 -- UnboxedTuples -- interferes with (#.)
128common threading-options
129 ghc-options: -threaded
130 -with-rtsopts=-N
132common optimization-options
133 if flag(opt) || flag(fusion-plugin)
134 ghc-options: -O2
135 -fdicts-strict
136 -fmax-worker-args=16
137 -fspec-constr-recursive=16
138 -- This must come after -O2
139 -fno-ignore-asserts
140 if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
141 ghc-options: -fplugin Fusion.Plugin
142 else
143 ghc-options: -O0
145common test-dependencies
146 build-depends:
147 streamly-core
148 , base >= 4.9 && < 4.20
149 , containers >= 0.5 && < 0.8
150 , exceptions >= 0.8 && < 0.11
151 , ghc
152 , hspec >= 2.0 && < 2.12
153 , mtl >= 2.2 && < 2.3.2
154 , random >= 1.0.0 && < 1.3
155 , transformers >= 0.4 && < 0.7
156 , QuickCheck >= 2.13 && < 2.15
157 , directory >= 1.2.2 && < 1.4
158 , filepath >= 1.4.1 && < 1.5
159 , temporary >= 1.3 && < 1.4
160 , network >= 3.1 && < 3.2
161 , scientific >= 0.0 && < 0.4
162 , template-haskell >= 2.12 && < 2.22
164 if !flag(use-streamly-core)
165 build-depends: streamly
167 if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
168 build-depends:
169 fusion-plugin >= 0.2 && < 0.3
171-------------------------------------------------------------------------------
172-- Library
173-------------------------------------------------------------------------------
175common lib-options
176 import: compile-options
177 , optimization-options
178 , default-extensions
179 , test-dependencies
181library
182 import: lib-options, test-dependencies
183 hs-source-dirs: lib
184 exposed-modules: Streamly.Test.Common
185 if !flag(use-streamly-core)
186 exposed-modules: Streamly.Test.Prelude.Common
187 if flag(limit-build-mem)
188 ghc-options: +RTS -M1500M -RTS
190-------------------------------------------------------------------------------
191-- Test suite options
192-------------------------------------------------------------------------------
194common test-options
195 import: lib-options
196 , threading-options
197 ghc-options: -rtsopts -fno-ignore-asserts
198 include-dirs: .
199 build-depends: streamly-tests
201common always-optimized
202 import: compile-options
203 , threading-options
204 , default-extensions
205 , test-dependencies
206 ghc-options: -O2
207 -fdicts-strict
208 -fmax-worker-args=16
209 -fspec-constr-recursive=16
210 -rtsopts
211 -fno-ignore-asserts
212 if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
213 ghc-options: -fplugin Fusion.Plugin
215-------------------------------------------------------------------------------
216-- Test suites in sorted order
217-------------------------------------------------------------------------------
219-- The Streamly.Data.List needs to be fixed to enable this
220-- test-suite Data.List
221-- import: test-options
222-- type: exitcode-stdio-1.0
223-- main-is: Streamly/Test/Data/List.hs
224-- cpp-options: -DUSE_STREAMLY_LIST
225-- if !flag(dev)
226-- buildable: False
228test-suite Data.List.Base
229 import: test-options
230 type: exitcode-stdio-1.0
231 main-is: Streamly/Test/Data/List.hs
233test-suite Data.Array.Generic
234 import: test-options
235 type: exitcode-stdio-1.0
236 main-is: Streamly/Test/Data/Array/Generic.hs
237 ghc-options: -main-is Streamly.Test.Data.Array.Generic.main
238 if flag(use-streamly-core)
239 buildable: False
241test-suite Data.Array
242 import: test-options
243 type: exitcode-stdio-1.0
244 main-is: Streamly/Test/Data/Array.hs
245 ghc-options: -main-is Streamly.Test.Data.Array.main
247test-suite Data.Stream
248 import: test-options
249 type: exitcode-stdio-1.0
250 main-is: Streamly/Test/Data/Stream.hs
251 ghc-options: -main-is Streamly.Test.Data.Stream.main
253test-suite Data.MutArray
254 import: test-options
255 type: exitcode-stdio-1.0
256 main-is: Streamly/Test/Data/MutArray.hs
257 ghc-options: -main-is Streamly.Test.Data.MutArray.main
259test-suite Data.Ring.Unboxed
260 import: test-options
261 type: exitcode-stdio-1.0
262 main-is: Streamly/Test/Data/Ring/Unboxed.hs
263 ghc-options: -main-is Streamly.Test.Data.Ring.Unboxed.main
264 if flag(use-streamly-core)
265 buildable: False
267test-suite Data.Unbox.Derive.Generic
268 import: test-options
269 type: exitcode-stdio-1.0
270 main-is: Streamly/Test/Data/Unbox.hs
271 ghc-options: -main-is Streamly.Test.Data.Unbox.main
273test-suite Data.Unbox.Derive.TH
274 import: test-options
275 type: exitcode-stdio-1.0
276 cpp-options: -DUSE_TH
277 main-is: Streamly/Test/Data/Unbox.hs
278 ghc-options: -main-is Streamly.Test.Data.Unbox.main
280test-suite Data.Serialize.Derive.TH
281 import: test-options
282 type: exitcode-stdio-1.0
283 cpp-options: -DUSE_SERIALIZE
284 main-is: Streamly/Test/Data/Unbox.hs
285 ghc-options: -main-is Streamly.Test.Data.Unbox.main
287test-suite Data.Unbox.TH
288 import: test-options
289 type: exitcode-stdio-1.0
290 main-is: Streamly/Test/Data/Unbox/TH.hs
291 ghc-options: -main-is Streamly.Test.Data.Unbox.TH.main
293test-suite Data.Serialize
294 import: test-options
295 type: exitcode-stdio-1.0
296 main-is: Streamly/Test/Data/Serialize.hs
297 other-modules:
298 Streamly.Test.Data.Serialize.TH
299 Streamly.Test.Data.Serialize.CompatV0
300 Streamly.Test.Data.Serialize.CompatV1
301 ghc-options: -main-is Streamly.Test.Data.Serialize.main
302 if flag(limit-build-mem)
303 ghc-options: +RTS -M1500M -RTS
305test-suite Data.Serialize.ENABLE_constructorTagAsString
306 import: test-options
307 type: exitcode-stdio-1.0
308 main-is: Streamly/Test/Data/Serialize.hs
309 other-modules:
310 Streamly.Test.Data.Serialize.TH
311 Streamly.Test.Data.Serialize.CompatV0
312 Streamly.Test.Data.Serialize.CompatV1
313 cpp-options: -DENABLE_constructorTagAsString
314 ghc-options: -main-is Streamly.Test.Data.Serialize.main
315 if flag(limit-build-mem)
316 ghc-options: +RTS -M1500M -RTS
318test-suite Data.Array.Stream
319 import: test-options
320 type: exitcode-stdio-1.0
321 main-is: Streamly/Test/Data/Array/Stream.hs
322 if flag(use-streamly-core)
323 buildable: False
325test-suite Data.Fold
326 import: test-options
327 type: exitcode-stdio-1.0
328 main-is: Streamly/Test/Data/Fold.hs
330test-suite Data.Fold.Window
331 import: test-options
332 type: exitcode-stdio-1.0
333 main-is: Streamly/Test/Data/Fold/Window.hs
334 ghc-options: -main-is Streamly.Test.Data.Fold.Window.main
336test-suite Data.Parser
337 import: test-options
338 type: exitcode-stdio-1.0
339 main-is: Streamly/Test/Data/Parser.hs
340 if flag(limit-build-mem)
341 ghc-options: +RTS -M4000M -RTS
343test-suite Data.ParserK
344 import: test-options
345 type: exitcode-stdio-1.0
346 main-is: Streamly/Test/Data/ParserK.hs
347 if flag(limit-build-mem)
348 ghc-options: +RTS -M1500M -RTS
350test-suite Data.SmallArray
351 import: test-options
352 type: exitcode-stdio-1.0
353 main-is: Streamly/Test/Data/SmallArray.hs
354 ghc-options: -main-is Streamly.Test.Data.SmallArray.main
355 if !flag(dev) || flag(use-streamly-core)
356 buildable: False
358test-suite Data.Unfold
359 import: test-options
360 type: exitcode-stdio-1.0
361 main-is: Streamly/Test/Data/Unfold.hs
363test-suite FileSystem.Event
364 import: test-options
365 type: exitcode-stdio-1.0
366 ghc-options: -main-is Streamly.Test.FileSystem.Event
367 main-is: Streamly/Test/FileSystem/Event.hs
368 other-modules: Streamly.Test.FileSystem.Event.Common
369 if flag(use-streamly-core)
370 buildable: False
372test-suite FileSystem.Event.Darwin
373 import: test-options
374 type: exitcode-stdio-1.0
375 main-is: Streamly/Test/FileSystem/Event/Darwin.hs
376 other-modules: Streamly.Test.FileSystem.Event.Common
377 cpp-options: -DFILESYSTEM_EVENT_DARWIN
378 ghc-options: -main-is Streamly.Test.FileSystem.Event.Darwin
379 if !os(darwin)
380 buildable: False
381 if flag(use-streamly-core)
382 buildable: False
384test-suite FileSystem.Event.Linux
385 import: test-options
386 type: exitcode-stdio-1.0
387 main-is: Streamly/Test/FileSystem/Event/Linux.hs
388 other-modules: Streamly.Test.FileSystem.Event.Common
389 cpp-options: -DFILESYSTEM_EVENT_LINUX
390 ghc-options: -main-is Streamly.Test.FileSystem.Event.Linux
391 if !os(linux) || !flag(dev) || flag(use-streamly-core)
392 buildable: False
394test-suite FileSystem.Event.Windows
395 import: test-options
396 type: exitcode-stdio-1.0
397 main-is: Streamly/Test/FileSystem/Event/Windows.hs
398 other-modules: Streamly.Test.FileSystem.Event.Common
399 cpp-options: -DFILESYSTEM_EVENT_WINDOWS
400 ghc-options: -main-is Streamly.Test.FileSystem.Event.Windows
401 if !os(windows)
402 buildable: False
403 if flag(use-streamly-core)
404 buildable: False
406test-suite FileSystem.Handle
407 import: test-options
408 type: exitcode-stdio-1.0
409 main-is: Streamly/Test/FileSystem/Handle.hs
410 ghc-options: -main-is Streamly.Test.FileSystem.Handle.main
411 if flag(use-streamly-core)
412 buildable: False
414test-suite Network.Inet.TCP
415 import: lib-options
416 type: exitcode-stdio-1.0
417 main-is: Streamly/Test/Network/Inet/TCP.hs
418 ghc-options: -rtsopts -fno-ignore-asserts
419 include-dirs: .
420 build-depends: streamly-tests
421 -- Cannot killThread in listen/accept on Windows threaded runtime
422 if !os(windows)
423 ghc-options: -threaded -with-rtsopts=-N
424 if flag(use-streamly-core)
425 buildable: False
427test-suite Network.Socket
428 import: lib-options
429 type: exitcode-stdio-1.0
430 main-is: Streamly/Test/Network/Socket.hs
431 ghc-options: -rtsopts -fno-ignore-asserts
432 include-dirs: .
433 build-depends: streamly-tests
434 -- Cannot killThread in listen/accept on Windows threaded runtime
435 if !os(windows)
436 ghc-options: -threaded -with-rtsopts=-N
437 if flag(use-streamly-core)
438 buildable: False
440test-suite Prelude
441 import: test-options
442 type: exitcode-stdio-1.0
443 main-is: Streamly/Test/Prelude.hs
444 ghc-options: -main-is Streamly.Test.Prelude.main
445 if flag(use-streamly-core)
446 buildable: False
448test-suite Prelude.Ahead
449 import: test-options
450 type: exitcode-stdio-1.0
451 main-is: Streamly/Test/Prelude/Ahead.hs
452 ghc-options: -main-is Streamly.Test.Prelude.Ahead.main
453 if flag(use-streamly-core)
454 buildable: False
456test-suite Prelude.Async
457 import: test-options
458 type: exitcode-stdio-1.0
459 main-is: Streamly/Test/Prelude/Async.hs
460 ghc-options: -main-is Streamly.Test.Prelude.Async.main
461 if flag(use-streamly-core)
462 buildable: False
464test-suite Data.Stream.Concurrent
465 import: test-options
466 type: exitcode-stdio-1.0
467 main-is: Streamly/Test/Data/Stream/Concurrent.hs
468 ghc-options: -main-is Streamly.Test.Data.Stream.Concurrent.main
469 if flag(use-streamly-core)
470 buildable: False
472test-suite Prelude.Concurrent
473 import: test-options
474 type: exitcode-stdio-1.0
475 main-is: Streamly/Test/Prelude/Concurrent.hs
476 ghc-options: -main-is Streamly.Test.Prelude.Concurrent.main
477 if flag(limit-build-mem)
478 ghc-options: +RTS -M2000M -RTS
479 if flag(use-streamly-core)
480 buildable: False
482test-suite Prelude.Fold
483 import: test-options
484 type: exitcode-stdio-1.0
485 main-is: Streamly/Test/Prelude/Fold.hs
486 ghc-options: -main-is Streamly.Test.Prelude.Fold.main
487 if flag(use-streamly-core)
488 buildable: False
490test-suite Prelude.Parallel
491 import: test-options
492 type: exitcode-stdio-1.0
493 main-is: Streamly/Test/Prelude/Parallel.hs
494 ghc-options: -main-is Streamly.Test.Prelude.Parallel.main
495 if flag(use-streamly-core)
496 buildable: False
498test-suite Prelude.Rate
499 import:always-optimized
500 type: exitcode-stdio-1.0
501 main-is: Streamly/Test/Prelude/Rate.hs
502 ghc-options: -main-is Streamly.Test.Prelude.Rate.main
503 if flag(dev)
504 buildable: True
505 else
506 buildable: False
507 if flag(use-streamly-core)
508 buildable: False
510test-suite Prelude.Serial
511 import: test-options
512 type: exitcode-stdio-1.0
513 main-is: Streamly/Test/Prelude/Serial.hs
514 ghc-options: -main-is Streamly.Test.Prelude.Serial.main
515 if flag(limit-build-mem)
516 ghc-options: +RTS -M1500M -RTS
517 if flag(use-streamly-core)
518 buildable: False
520test-suite Prelude.Top
521 import: test-options
522 type: exitcode-stdio-1.0
523 main-is: Streamly/Test/Prelude/Top.hs
524 if flag(use-streamly-core)
525 buildable: False
527test-suite Prelude.WAsync
528 import: test-options
529 type: exitcode-stdio-1.0
530 main-is: Streamly/Test/Prelude/WAsync.hs
531 ghc-options: -main-is Streamly.Test.Prelude.WAsync.main
532 if flag(use-streamly-core)
533 buildable: False
535test-suite Prelude.WSerial
536 import: test-options
537 type: exitcode-stdio-1.0
538 main-is: Streamly/Test/Prelude/WSerial.hs
539 ghc-options: -main-is Streamly.Test.Prelude.WSerial.main
540 if flag(use-streamly-core)
541 buildable: False
543test-suite Prelude.ZipAsync
544 import: test-options
545 type: exitcode-stdio-1.0
546 main-is: Streamly/Test/Prelude/ZipAsync.hs
547 ghc-options: -main-is Streamly.Test.Prelude.ZipAsync.main
548 if flag(limit-build-mem)
549 ghc-options: +RTS -M750M -RTS
550 if flag(use-streamly-core)
551 buildable: False
553test-suite Prelude.ZipSerial
554 import: test-options
555 type: exitcode-stdio-1.0
556 main-is: Streamly/Test/Prelude/ZipSerial.hs
557 ghc-options: -main-is Streamly.Test.Prelude.ZipSerial.main
558 if flag(use-streamly-core)
559 buildable: False
561test-suite Unicode.Stream
562 import: test-options
563 type: exitcode-stdio-1.0
564 main-is: Streamly/Test/Unicode/Stream.hs
565 ghc-options: -main-is Streamly.Test.Unicode.Stream.main
566 if flag(use-streamly-core)
567 buildable: False
569test-suite Unicode.Parser
570 import: test-options
571 type: exitcode-stdio-1.0
572 main-is: Streamly/Test/Unicode/Parser.hs
573 ghc-options: -main-is Streamly.Test.Unicode.Parser.main
574 if flag(use-streamly-core)
575 buildable: False
577test-suite Unicode.Char
578 import: test-options
579 type: exitcode-stdio-1.0
580 main-is: Streamly/Test/Unicode/Char.hs
581 ghc-options: -main-is Streamly.Test.Unicode.Char.main
582 if flag(use-streamly-core) || !flag(dev)
583 buildable: False
585test-suite Serialize.Serializable
586 import: test-options
587 type: exitcode-stdio-1.0
588 main-is: Streamly/Test/Serialize/Serializable.hs
590test-suite version-bounds
591 import: test-options
592 type: exitcode-stdio-1.0
593 main-is: version-bounds.hs