-
Notifications
You must be signed in to change notification settings - Fork 66
/
Copy pathstreamly-tests.cabal
646 lines (558 loc) · 18.2 KB
/
streamly-tests.cabal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
cabal-version: 2.2
name: streamly-tests
version: 0.0.0
synopsis: Tests for streamly
description: See streamly-benchmarks for the reason why we use a separate
package for tests.
flag fusion-plugin
description: Use fusion plugin for benchmarks and executables
manual: True
default: False
flag limit-build-mem
description: Limits memory when building the executables
manual: True
default: False
flag use-large-mem
description: Include tests that require large amount of memory
manual: True
default: False
flag include-flaky-tests
description: Include tests that are unpredictable
manual: True
default: False
flag dev
description: Development build
manual: True
default: False
flag has-llvm
description: Use llvm backend for better performance
manual: True
default: False
flag opt
description: off=-O0 (faster builds), on=-O2
manual: True
default: True
flag use-streamly-core
description: Test only core package
manual: True
default: False
-------------------------------------------------------------------------------
-- Common stanzas
-------------------------------------------------------------------------------
common compile-options
if os(darwin)
cpp-options: -DCABAL_OS_DARWIN
if os(linux)
cpp-options: -DCABAL_OS_LINUX
if os(windows)
cpp-options: -DCABAL_OS_WINDOWS
if flag(dev)
cpp-options: -DDEVBUILD
ghc-options: -Wall
-Wcompat
-Wunrecognised-warning-flags
-Widentities
-Wincomplete-record-updates
-Wincomplete-uni-patterns
-Wredundant-constraints
-Wnoncanonical-monad-instances
-Wmissing-export-lists
-Rghc-timing
if flag(has-llvm)
ghc-options: -fllvm
if flag(dev)
ghc-options: -Wmissed-specialisations
-Wall-missed-specialisations
if flag(limit-build-mem)
ghc-options: +RTS -M512M -RTS
if flag(use-large-mem)
cpp-options: -DUSE_LARGE_MEMORY
if flag(include-flaky-tests)
cpp-options: -DINCLUDE_FLAKY_TESTS
common default-extensions
default-language: Haskell2010
-- GHC2024 may include more extensions than we are actually using, see the
-- full list below. We enable this to ensure that we are able to compile
-- with this i.e. there is no interference by other extensions.
if impl(ghc >= 9.10)
default-language: GHC2024
if impl(ghc >= 9.2) && impl(ghc < 9.10)
default-language: GHC2021
if impl(ghc >= 8.10)
default-extensions: StandaloneKindSignatures
-- In GHC 2024
default-extensions:
BangPatterns
ConstraintKinds
DeriveDataTypeable
DeriveGeneric
DeriveTraversable
ExistentialQuantification
FlexibleContexts
FlexibleInstances
GeneralizedNewtypeDeriving
InstanceSigs
KindSignatures
LambdaCase
MultiParamTypeClasses
RankNTypes
ScopedTypeVariables
TupleSections
-- Not in GHC2024
CPP
MagicHash
PatternSynonyms
RecordWildCards
NoMonoLocalBinds
common threading-options
ghc-options: -threaded
-with-rtsopts=-N
common optimization-options
if flag(opt) || flag(fusion-plugin)
ghc-options: -O2
-fdicts-strict
-fmax-worker-args=16
-fspec-constr-recursive=16
-- This must come after -O2
-fno-ignore-asserts
if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
ghc-options: -fplugin Fusion.Plugin
else
ghc-options: -O0
common test-dependencies
build-depends:
streamly-core
, base >= 4.9 && < 4.22
, containers >= 0.5 && < 0.8
, exceptions >= 0.8 && < 0.11
, ghc
, hspec >= 2.0 && < 2.12
, mtl >= 2.2 && < 2.3.2
, random >= 1.0.0 && < 1.3
, transformers >= 0.4 && < 0.7
, QuickCheck >= 2.13 && < 2.16
, directory >= 1.2.2 && < 1.4
, filepath >= 1.4.1 && < 1.6
, temporary >= 1.3 && < 1.4
, network >= 3.1 && < 3.3
, scientific >= 0.0 && < 0.4
, template-haskell >= 2.12 && < 2.24
if !flag(use-streamly-core)
build-depends: streamly
if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
build-depends:
fusion-plugin >= 0.2 && < 0.3
-------------------------------------------------------------------------------
-- Library
-------------------------------------------------------------------------------
common lib-options
import: compile-options
, optimization-options
, default-extensions
, test-dependencies
library
import: lib-options, test-dependencies
hs-source-dirs: lib
exposed-modules:
Streamly.Test.Common
Streamly.Test.Parser.Common
if !flag(use-streamly-core)
exposed-modules: Streamly.Test.Prelude.Common
if flag(limit-build-mem)
ghc-options: +RTS -M1500M -RTS
-------------------------------------------------------------------------------
-- Test suite options
-------------------------------------------------------------------------------
common test-options
import: lib-options
, threading-options
ghc-options:
-rtsopts
-with-rtsopts "-t"
-fno-ignore-asserts
include-dirs: .
build-depends: streamly-tests
common always-optimized
import: compile-options
, threading-options
, default-extensions
, test-dependencies
ghc-options: -O2
-fdicts-strict
-fmax-worker-args=16
-fspec-constr-recursive=16
-rtsopts
-with-rtsopts "-t"
-fno-ignore-asserts
if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
ghc-options: -fplugin Fusion.Plugin
-------------------------------------------------------------------------------
-- Test suites in alphabetical order
-------------------------------------------------------------------------------
test-suite Data.Array
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Data/Array.hs
ghc-options: -main-is Streamly.Test.Data.Array.main
test-suite Data.Array.Generic
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Data/Array/Generic.hs
ghc-options: -main-is Streamly.Test.Data.Array.Generic.main
if flag(use-streamly-core)
buildable: False
test-suite Data.Array.Stream
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Data/Array/Stream.hs
if flag(use-streamly-core)
buildable: False
test-suite Data.Binary
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Serialize/Serializable.hs
test-suite Data.Fold
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Data/Fold.hs
test-suite Data.Fold.Window
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Data/Fold/Window.hs
ghc-options: -main-is Streamly.Test.Data.Fold.Window.main
-- The Streamly.Data.List needs to be fixed to enable this
-- test-suite Data.List
-- import: test-options
-- type: exitcode-stdio-1.0
-- main-is: Streamly/Test/Data/List.hs
-- cpp-options: -DUSE_STREAMLY_LIST
-- if !flag(dev)
-- buildable: False
test-suite Data.List.Base
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Data/List.hs
test-suite Data.MutArray
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Data/MutArray.hs
ghc-options: -main-is Streamly.Test.Data.MutArray.main
test-suite Data.Parser
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Data/Parser.hs
if flag(limit-build-mem)
ghc-options: +RTS -M4000M -RTS
test-suite Data.ParserK
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Data/ParserK.hs
if flag(limit-build-mem)
ghc-options: +RTS -M1500M -RTS
test-suite Data.RingArray
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Data/RingArray.hs
ghc-options: -main-is Streamly.Test.Data.RingArray.main
test-suite Data.Scanl.Concurrent
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Data/Scanl/Concurrent.hs
ghc-options: -main-is Streamly.Test.Data.Scanl.Concurrent.main
if flag(use-streamly-core)
buildable: False
-- XXX Rename to MutByteArray
test-suite Data.Serialize
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Data/Serialize.hs
other-modules:
Streamly.Test.Data.Serialize.TH
Streamly.Test.Data.Serialize.CompatV0
Streamly.Test.Data.Serialize.CompatV1
ghc-options: -main-is Streamly.Test.Data.Serialize.main
if flag(limit-build-mem)
ghc-options: +RTS -M1500M -RTS
test-suite Data.Serialize.Derive.TH
import: test-options
type: exitcode-stdio-1.0
cpp-options: -DUSE_SERIALIZE
main-is: Streamly/Test/Data/Unbox.hs
ghc-options: -main-is Streamly.Test.Data.Unbox.main
test-suite Data.Serialize.ENABLE_constructorTagAsString
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Data/Serialize.hs
other-modules:
Streamly.Test.Data.Serialize.TH
Streamly.Test.Data.Serialize.CompatV0
Streamly.Test.Data.Serialize.CompatV1
cpp-options: -DENABLE_constructorTagAsString
ghc-options: -main-is Streamly.Test.Data.Serialize.main
if flag(limit-build-mem)
ghc-options: +RTS -M1500M -RTS
test-suite Data.SmallArray
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Data/SmallArray.hs
ghc-options: -main-is Streamly.Test.Data.SmallArray.main
if !flag(dev) || flag(use-streamly-core)
buildable: False
test-suite Data.Stream
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Data/Stream.hs
ghc-options: -main-is Streamly.Test.Data.Stream.main
if flag(limit-build-mem)
ghc-options: +RTS -M1500M -RTS
test-suite Data.Stream.Concurrent
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Data/Stream/Concurrent.hs
ghc-options: -main-is Streamly.Test.Data.Stream.Concurrent.main
if flag(use-streamly-core)
buildable: False
test-suite Data.Stream.Time
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Data/Stream/Time.hs
ghc-options: -main-is Streamly.Test.Data.Stream.Time.main
if flag(use-streamly-core)
buildable: False
test-suite Data.Stream.Rate
import:always-optimized
type: exitcode-stdio-1.0
main-is: Streamly/Test/Data/Stream/Rate.hs
ghc-options: -main-is Streamly.Test.Data.Stream.Rate.main
if flag(dev)
buildable: True
else
buildable: False
if flag(use-streamly-core)
buildable: False
-- XXX Rename to MutByteArray.Unbox
test-suite Data.Unbox.Derive.Generic
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Data/Unbox.hs
ghc-options: -main-is Streamly.Test.Data.Unbox.main
test-suite Data.Unbox.Derive.TH
import: test-options
type: exitcode-stdio-1.0
cpp-options: -DUSE_TH
main-is: Streamly/Test/Data/Unbox.hs
ghc-options: -main-is Streamly.Test.Data.Unbox.main
test-suite Data.Unbox.TH
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Data/Unbox/TH.hs
ghc-options: -main-is Streamly.Test.Data.Unbox.TH.main
test-suite Data.Unfold
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Data/Unfold.hs
test-suite FileSystem.Event
import: test-options
type: exitcode-stdio-1.0
ghc-options: -main-is Streamly.Test.FileSystem.Event
main-is: Streamly/Test/FileSystem/Event.hs
other-modules: Streamly.Test.FileSystem.Event.Common
if !(os(linux) || os(darwin) || os(windows)) || flag(use-streamly-core)
buildable: False
test-suite FileSystem.Event.Darwin
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/FileSystem/Event/Darwin.hs
other-modules: Streamly.Test.FileSystem.Event.Common
cpp-options: -DFILESYSTEM_EVENT_DARWIN
ghc-options: -main-is Streamly.Test.FileSystem.Event.Darwin
if !os(darwin) || flag(use-streamly-core)
buildable: False
test-suite FileSystem.Event.Linux
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/FileSystem/Event/Linux.hs
other-modules: Streamly.Test.FileSystem.Event.Common
cpp-options: -DFILESYSTEM_EVENT_LINUX
ghc-options: -main-is Streamly.Test.FileSystem.Event.Linux
if !os(linux) || flag(use-streamly-core)
buildable: False
test-suite FileSystem.Event.Windows
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/FileSystem/Event/Windows.hs
other-modules: Streamly.Test.FileSystem.Event.Common
cpp-options: -DFILESYSTEM_EVENT_WINDOWS
ghc-options: -main-is Streamly.Test.FileSystem.Event.Windows
if !os(windows) || flag(use-streamly-core)
buildable: False
test-suite FileSystem.Handle
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/FileSystem/Handle.hs
ghc-options: -main-is Streamly.Test.FileSystem.Handle.main
if flag(use-streamly-core)
buildable: False
test-suite FileSystem.DirIO
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/FileSystem/DirIO.hs
if flag(use-streamly-core)
buildable: False
build-depends:
bench-test-lib
-- Fix this test-suite for Windows
if os(windows)
buildable: False
test-suite Network.Inet.TCP
import: lib-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Network/Inet/TCP.hs
ghc-options: -rtsopts -fno-ignore-asserts
include-dirs: .
build-depends: streamly-tests
-- Cannot killThread in listen/accept on Windows threaded runtime
if !os(windows)
ghc-options: -threaded -with-rtsopts=-N
if flag(use-streamly-core)
buildable: False
test-suite Network.Socket
import: lib-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Network/Socket.hs
ghc-options: -rtsopts -fno-ignore-asserts
include-dirs: .
build-depends: streamly-tests
-- Cannot killThread in listen/accept on Windows threaded runtime
if !os(windows)
ghc-options: -threaded -with-rtsopts=-N
if flag(use-streamly-core)
buildable: False
test-suite Unicode.Char
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Unicode/Char.hs
ghc-options: -main-is Streamly.Test.Unicode.Char.main
if flag(use-streamly-core) || !flag(dev)
buildable: False
test-suite Unicode.Parser
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Unicode/Parser.hs
ghc-options: -main-is Streamly.Test.Unicode.Parser.main
if flag(use-streamly-core)
buildable: False
test-suite Unicode.Stream
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Unicode/Stream.hs
ghc-options: -main-is Streamly.Test.Unicode.Stream.main
if flag(use-streamly-core)
buildable: False
test-suite version-bounds
import: test-options
type: exitcode-stdio-1.0
main-is: version-bounds.hs
-------------------------------------------------------------------------------
-- Deprecated
-------------------------------------------------------------------------------
test-suite Prelude
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Prelude.hs
ghc-options: -main-is Streamly.Test.Prelude.main
if flag(use-streamly-core)
buildable: False
test-suite Prelude.Ahead
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Prelude/Ahead.hs
ghc-options: -main-is Streamly.Test.Prelude.Ahead.main
if flag(use-streamly-core)
buildable: False
test-suite Prelude.Async
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Prelude/Async.hs
ghc-options: -main-is Streamly.Test.Prelude.Async.main
if flag(use-streamly-core)
buildable: False
test-suite Prelude.Concurrent
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Prelude/Concurrent.hs
ghc-options: -main-is Streamly.Test.Prelude.Concurrent.main
if flag(limit-build-mem)
ghc-options: +RTS -M2000M -RTS
if flag(use-streamly-core)
buildable: False
test-suite Prelude.Fold
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Prelude/Fold.hs
ghc-options: -main-is Streamly.Test.Prelude.Fold.main
if flag(use-streamly-core)
buildable: False
test-suite Prelude.Parallel
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Prelude/Parallel.hs
ghc-options: -main-is Streamly.Test.Prelude.Parallel.main
if flag(use-streamly-core)
buildable: False
test-suite Prelude.Rate
import:always-optimized
type: exitcode-stdio-1.0
main-is: Streamly/Test/Prelude/Rate.hs
ghc-options: -main-is Streamly.Test.Prelude.Rate.main
if flag(dev)
buildable: True
else
buildable: False
if flag(use-streamly-core)
buildable: False
test-suite Prelude.Serial
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Prelude/Serial.hs
ghc-options: -main-is Streamly.Test.Prelude.Serial.main
if flag(limit-build-mem)
ghc-options: +RTS -M1500M -RTS
if flag(use-streamly-core)
buildable: False
test-suite Prelude.Top
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Prelude/Top.hs
if flag(use-streamly-core)
buildable: False
test-suite Prelude.WAsync
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Prelude/WAsync.hs
ghc-options: -main-is Streamly.Test.Prelude.WAsync.main
if flag(use-streamly-core)
buildable: False
test-suite Prelude.WSerial
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Prelude/WSerial.hs
ghc-options: -main-is Streamly.Test.Prelude.WSerial.main
if flag(use-streamly-core)
buildable: False
test-suite Prelude.ZipAsync
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Prelude/ZipAsync.hs
ghc-options: -main-is Streamly.Test.Prelude.ZipAsync.main
if flag(limit-build-mem)
ghc-options: +RTS -M750M -RTS
if flag(use-streamly-core)
buildable: False
test-suite Prelude.ZipSerial
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Prelude/ZipSerial.hs
ghc-options: -main-is Streamly.Test.Prelude.ZipSerial.main
if flag(use-streamly-core)
buildable: False