on master help sign in
Separate streamly tests into another package
b677d0dHarendra Kumar
.circleci/config.yml+1
@@ -193,6 +193,7 @@ jobs:
193 command: |
193 command: |
194 apt-get install -y ghc-8.2.2
194 apt-get install -y ghc-8.2.2
195 apt-get install -y cabal-install-3.2
195 apt-get install -y cabal-install-3.2
196+ apt-get install libtinfo-dev
196 bash -c "$PACKCHECK $BUILD"
197 bash -c "$PACKCHECK $BUILD"
197 - *save
198 - *save
198 cabal-ghc-8_0_2:
199 cabal-ghc-8_0_2:
benchmark/README.md+68−2
@@ -1,11 +1,77 @@
1+## Building a single benchmark suite
2+
3+```
4+$ cabal build streamly-benchmarks:Prelude.Serial
5+```
6+
7+or:
8+
9+```
10+$ cabal build --enable-benchmarks bench:Prelude.Serial
11+```
12+
13+## Building all benchmarks suites
14+
15+```
16+$ cabal build --enable-benchmarks streamly-benchmarks
17+```
18+
19+or:
20+
21+```
22+$ cabal build --enable-benchmarks all
23+```
24+
25+Disable optimization, quick build:
26+
27+```
28+$ cabal build --flag "-opt" ...
29+```
30+
31+## Build and run single benchmarks:
32+
33+For quick results you may have to use `--quick` and possibly some other
34+`gauge` options, or better use `bench.sh --quick` as described in the
35+following sections.
36+
37+```
38+$ cabal run bench:Prelude.Serial -- --quick
39+```
40+
41+`cabal bench` can be used but you cannot pass arguments (like --quick):
42+
43+```
44+$ cabal bench Prelude.Serial
45+```
46+
47+## Build and run all benchmarks
48+
49+Don't try this, it will take too long, use the `bench.sh` method instead.
50+
51+```
52+$ cabal bench all
53+```
54+
55+or:
56+
57+```
58+$ cd benchmark; cabal bench
59+```
60+
61+or this, note this command does not work from "benchmark" dir:
62+
63+```
64+$ cabal bench streamly-benchmarks
65+```
66+
1−## Running Benchmarks
67+## Building and Running Benchmarks with bench.sh
2
68
3`bench.sh` script at the root of the repo is the top level driver for running
69`bench.sh` script at the root of the repo is the top level driver for running
4benchmarks. It runs the requested benchmarks and then creates a report from the
70benchmarks. It runs the requested benchmarks and then creates a report from the
5results using the `bench-show` package. Try `bench.sh --help` for available
71results using the `bench-show` package. Try `bench.sh --help` for available
6options to run it.
72options to run it.
7
73
8−## Quick start
74+## bench.sh: Quick start
9
75
10You must be in the repo root directory to run these commands.
76You must be in the repo root directory to run these commands.
11
77
benchmark/streamly-benchmarks.cabal+17−15
@@ -9,8 +9,8 @@ description: Benchmarks are separated from the main package because we
9 for serial, async, ahead style streams, therefore, we need to use
9 for serial, async, ahead style streams, therefore, we need to use
10 the common code in several benchmarks, just changing the type of
10 the common code in several benchmarks, just changing the type of
11 the stream. It takes a long time to compile this file and it gets
11 the stream. It takes a long time to compile this file and it gets
12− compiled for each benchmarks once if we do not have a library. Cabal
12+ compiled for each benchmark once if we do not have a library. Cabal
13− does no support internal libraries without per-component builds and
13+ does not support internal libraries without per-component builds and
14 per-component builds are not supported with Configure, so we are not
14 per-component builds are not supported with Configure, so we are not
15 left with any other choice.
15 left with any other choice.
16
16
@@ -44,6 +44,11 @@ flag no-charts
44 manual: True
44 manual: True
45 default: False
45 default: False
46
46
47+flag opt
48+ description: off=-O0 (faster builds), on=-O2
49+ manual: True
50+ default: True
51+
47-------------------------------------------------------------------------------
52-------------------------------------------------------------------------------
48-- Common stanzas
53-- Common stanzas
49-------------------------------------------------------------------------------
54-------------------------------------------------------------------------------
@@ -78,19 +83,16 @@ common compile-options
78 ghc-options: -fno-ignore-asserts
83 ghc-options: -fno-ignore-asserts
79
84
80common optimization-options
85common optimization-options
86+ if flag(opt)
81− ghc-options: -O2
87+ ghc-options: -O2
82− -fdicts-strict
88+ -fdicts-strict
83− -fspec-constr-recursive=16
89+ -fspec-constr-recursive=16
84− -fmax-worker-args=16
90+ -fmax-worker-args=16
85− if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
91+ if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
86− ghc-options: -fplugin Fusion.Plugin
92+ ghc-options: -fplugin Fusion.Plugin
87−
93+ else
88−-- We need optimization options here to optimize internal (non-inlined)
94+ ghc-options: -O0
89−-- versions of functions. Also, we have some benchmarking inspection tests
95+
90−-- part of the library when built with --benchmarks flag. Thos tests fail
91−-- if we do not use optimization options here. It was observed that due to
92−-- -O2 here some concurrent/nested benchmarks improved and others regressed.
93−-- We can investigate a bit more here why the regression occurred.
94common lib-options
96common lib-options
95 import: compile-options, optimization-options
97 import: compile-options, optimization-options
96
98
cabal.project+2−1
@@ -1,4 +1,5 @@
1packages: streamly.cabal
1packages: streamly.cabal
2+ , test/streamly-tests.cabal
2− , benchmark/streamly-benchmarks.cabal
3+ , benchmark/streamly-benchmarks.cabal
3
4
4
5
cabal.project.coverage+3
@@ -17,3 +17,6 @@ package streamly
17package streamly-benchmarks
17package streamly-benchmarks
18 ghc-options: -Werror
18 ghc-options: -Werror
19 flags: inspection
19 flags: inspection
20+
21+package streamly-tests
22+ ghc-options: -Werror
default.nix+4
@@ -51,6 +51,9 @@ let haskellPackages =
51 streamly-benchmarks =
51 streamly-benchmarks =
52 mkPackage super "streamly-benchmarks"
52 mkPackage super "streamly-benchmarks"
53 ./benchmark flags inShell;
53 ./benchmark flags inShell;
54+ streamly-tests =
55+ mkPackage super "streamly-tests"
56+ ./test flags inShell;
54
57
55 # Example to Use a different version of a package
58 # Example to Use a different version of a package
56 #QuickCheck = self.QuickCheck_2_14;
59 #QuickCheck = self.QuickCheck_2_14;
@@ -78,6 +81,7 @@ let haskellPackages =
78 packages = p:
81 packages = p:
79 [ p.streamly
82 [ p.streamly
80 p.streamly-benchmarks
83 p.streamly-benchmarks
84+ p.streamly-tests
81 ];
85 ];
82 # some dependencies of hoogle fail to build with quickcheck-2.14
86 # some dependencies of hoogle fail to build with quickcheck-2.14
83 # We should use hoogle as external tool instead of building it here
87 # We should use hoogle as external tool instead of building it here
stack.yaml+1
@@ -2,6 +2,7 @@ resolver: lts-16.12
2packages:
2packages:
3- '.'
3- '.'
4- './benchmark'
4- './benchmark'
5+- './test'
5extra-deps:
6extra-deps:
6- SDL-0.6.7.0@sha256:9d6ba75c0cab575ec38468c8277803983e985f9622437aeca6a53e6a7337a7d5,2045
7- SDL-0.6.7.0@sha256:9d6ba75c0cab575ec38468c8277803983e985f9622437aeca6a53e6a7337a7d5,2045
7- QuickCheck-2.14.1@sha256:01e46d7b0a8d3148288ec977625f62d5516ebb5031a50c63f0453863301b4a79,7736
8- QuickCheck-2.14.1@sha256:01e46d7b0a8d3148288ec977625f62d5516ebb5031a50c63f0453863301b4a79,7736
streamly.cabal+24−235
@@ -157,7 +157,21 @@ extra-source-files:
157 src/Streamly/Internal/FileSystem/Event/Darwin.h
157 src/Streamly/Internal/FileSystem/Event/Darwin.h
158 src/config.h.in
158 src/config.h.in
159 src/inline.hs
159 src/inline.hs
160+ test/README.md
160 test/Streamly/Test/Common/Array.hs
161 test/Streamly/Test/Common/Array.hs
162+ test/Streamly/Test/Data/*.hs
163+ test/Streamly/Test/Data/Array/Prim.hs
164+ test/Streamly/Test/Data/Array/Prim/Pinned.hs
165+ test/Streamly/Test/Data/Array/Storable/Foreign.hs
166+ test/Streamly/Test/Data/Parser/ParserD.hs
167+ test/Streamly/Test/FileSystem/Event.hs
168+ test/Streamly/Test/Prelude.hs
169+ test/Streamly/Test/Prelude/*.hs
170+ test/Streamly/Test/Unicode/Stream.hs
171+ test/lib/Streamly/Test/Common.hs
172+ test/lib/Streamly/Test/Prelude/Common.hs
173+ test/streamly-tests.cabal
174+ test/version-bounds.hs
161 stack.yaml
175 stack.yaml
162
176
163extra-tmp-files:
177extra-tmp-files:
@@ -210,6 +224,11 @@ flag use-c-malloc
210 manual: True
224 manual: True
211 default: False
225 default: False
212
226
227+flag opt
228+ description: off=GHC default, on=-O2
229+ manual: True
230+ default: True
231+
213-------------------------------------------------------------------------------
232-------------------------------------------------------------------------------
214-- Common stanzas
233-- Common stanzas
215-------------------------------------------------------------------------------
234-------------------------------------------------------------------------------
@@ -296,10 +315,11 @@ common default-extensions
296 -- UnboxedTuples -- interferes with (#.)
315 -- UnboxedTuples -- interferes with (#.)
297
316
298common optimization-options
317common optimization-options
318+ if flag(opt)
299− ghc-options: -O2
319+ ghc-options: -O2
300− -fdicts-strict
320+ -fdicts-strict
301− -fspec-constr-recursive=16
321+ -fspec-constr-recursive=16
302− -fmax-worker-args=16
322+ -fmax-worker-args=16
303
323
304common threading-options
324common threading-options
305 ghc-options: -threaded
325 ghc-options: -threaded
@@ -314,50 +334,6 @@ common threading-options
314common lib-options
334common lib-options
315 import: compile-options, optimization-options, default-extensions
335 import: compile-options, optimization-options, default-extensions
316
336
317−common test-dependencies
318− build-depends:
319− streamly
320− , base >= 4.9 && < 5
321− , containers >= 0.5 && < 0.7
322− , exceptions >= 0.8 && < 0.11
323− , ghc
324− , hspec >= 2.0 && < 3
325− , mtl >= 2.2 && < 3
326− , random >= 1.0.0 && < 2
327− , transformers >= 0.4 && < 0.6
328− , QuickCheck >= 2.13 && < 2.15
329− , directory >= 1.2.2 && < 1.4
330− , filepath >= 1.4.1 && < 1.5
331− , temporary >= 1.3 && < 1.4
332−
333−-- Compilation for coverage builds on CI machines takes too long without -O0
334−-- XXX we should use coverage flag for that, -O0 may take too long to run tests
335−-- in general.
336−common test-options
337− import: compile-options, threading-options, default-extensions
338− ,test-dependencies
339−
340− ghc-options: -O0
341− -fno-ignore-asserts
342− include-dirs: test
343− -- XXX we need -O for plugin to work
344− -- if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
345− -- ghc-options: -fplugin Fusion.Plugin
346− -- build-depends:
347− -- fusion-plugin >= 0.2 && < 0.3
348−
349− hs-source-dirs: test
350− js-sources: jsbits/clock.js
351− default-language: Haskell2010
352−
353−-- Used by maxrate test, benchmarks and executables
354−common exe-options
355− import: compile-options, optimization-options, threading-options
356− if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
357− ghc-options: -fplugin Fusion.Plugin
358− build-depends:
359− fusion-plugin >= 0.2 && < 0.3
360−
361-------------------------------------------------------------------------------
337-------------------------------------------------------------------------------
362-- Library
338-- Library
363-------------------------------------------------------------------------------
339-------------------------------------------------------------------------------
@@ -558,190 +534,3 @@ library
558 -- tests fail
534 -- tests fail
559 if flag(dev) && flag(inspection)
535 if flag(dev) && flag(inspection)
560 build-depends: inspection-and-dev-flags-cannot-be-used-together
536 build-depends: inspection-and-dev-flags-cannot-be-used-together
561−
562−-------------------------------------------------------------------------------
563−-- Test suites
564−-------------------------------------------------------------------------------
565−
566−test-suite Data.List.Base
567− import: test-options
568− type: exitcode-stdio-1.0
569− main-is: Streamly/Test/Data/List.hs
570−
571−test-suite Data.List
572− import: test-options
573− type: exitcode-stdio-1.0
574− main-is: Streamly/Test/Data/List.hs
575− cpp-options: -DUSE_STREAMLY_LIST
576−
577−test-suite Prelude
578− import: test-options
579− type: exitcode-stdio-1.0
580− main-is: Streamly/Test/Prelude.hs
581− ghc-options: -main-is Streamly.Test.Prelude.main
582−
583−test-suite Prelude.Serial
584− import: test-options
585− type: exitcode-stdio-1.0
586− main-is: Streamly/Test/Prelude/Serial.hs
587− ghc-options: -main-is Streamly.Test.Prelude.Serial.main
588− other-modules: Streamly.Test.Common
589− , Streamly.Test.Prelude.Common
590−
591−test-suite Prelude.WSerial
592− import: test-options
593− type: exitcode-stdio-1.0
594− main-is: Streamly/Test/Prelude/WSerial.hs
595− ghc-options: -main-is Streamly.Test.Prelude.WSerial.main
596− other-modules: Streamly.Test.Common
597− , Streamly.Test.Prelude.Common
598−
599−test-suite Prelude.ZipSerial
600− import: test-options
601− type: exitcode-stdio-1.0
602− main-is: Streamly/Test/Prelude/ZipSerial.hs
603− ghc-options: -main-is Streamly.Test.Prelude.ZipSerial.main
604− other-modules: Streamly.Test.Common
605− , Streamly.Test.Prelude.Common
606−
607−test-suite Prelude.ZipAsync
608− import: test-options
609− type: exitcode-stdio-1.0
610− main-is: Streamly/Test/Prelude/ZipAsync.hs
611− ghc-options: -main-is Streamly.Test.Prelude.ZipAsync.main
612− other-modules: Streamly.Test.Common
613− , Streamly.Test.Prelude.Common
614−
615−test-suite Prelude.Ahead
616− import: test-options
617− type: exitcode-stdio-1.0
618− main-is: Streamly/Test/Prelude/Ahead.hs
619− ghc-options: -main-is Streamly.Test.Prelude.Ahead.main
620− other-modules: Streamly.Test.Common
621− , Streamly.Test.Prelude.Common
622−
623−test-suite Prelude.Async
624− import: test-options
625− type: exitcode-stdio-1.0
626− main-is: Streamly/Test/Prelude/Async.hs
627− ghc-options: -main-is Streamly.Test.Prelude.Async.main
628− other-modules: Streamly.Test.Common
629− , Streamly.Test.Prelude.Common
630−
631−test-suite Prelude.WAsync
632− import: test-options
633− type: exitcode-stdio-1.0
634− main-is: Streamly/Test/Prelude/WAsync.hs
635− ghc-options: -main-is Streamly.Test.Prelude.WAsync.main
636− other-modules: Streamly.Test.Common
637− , Streamly.Test.Prelude.Common
638−
639−test-suite Prelude.Parallel
640− import: test-options
641− type: exitcode-stdio-1.0
642− main-is: Streamly/Test/Prelude/Parallel.hs
643− ghc-options: -main-is Streamly.Test.Prelude.Parallel.main
644− other-modules: Streamly.Test.Common
645− , Streamly.Test.Prelude.Common
646−
647−test-suite Prelude.Concurrent
648− import: test-options
649− type: exitcode-stdio-1.0
650− main-is: Streamly/Test/Prelude/Concurrent.hs
651− ghc-options: -main-is Streamly.Test.Prelude.Concurrent.main
652− other-modules: Streamly.Test.Common
653− , Streamly.Test.Prelude.Common
654− build-depends: mtl >= 2.2 && < 3
655−
656−test-suite Prelude.Fold
657− import: test-options
658− type: exitcode-stdio-1.0
659− main-is: Streamly/Test/Prelude/Fold.hs
660− ghc-options: -main-is Streamly.Test.Prelude.Fold.main
661− other-modules: Streamly.Test.Common
662− , Streamly.Test.Prelude.Common
663−
664−test-suite Prelude.MaxRate
665− import: test-options, exe-options
666− type: exitcode-stdio-1.0
667− main-is: Streamly/Test/Prelude/MaxRate.hs
668− ghc-options: -main-is Streamly.Test.Prelude.MaxRate.main
669− if flag(dev)
670− buildable: True
671− else
672− buildable: False
673−
674−test-suite Data.Array.Storable.Foreign
675− import: test-options
676− type: exitcode-stdio-1.0
677− main-is: Streamly/Test/Data/Array/Storable/Foreign.hs
678− ghc-options: -main-is Streamly.Test.Data.Array.Storable.Foreign.main
679−
680−test-suite Data.Fold
681− import: test-options
682− type: exitcode-stdio-1.0
683− main-is: Streamly/Test/Data/Fold.hs
684− other-modules: Streamly.Test.Common
685−
686−test-suite Data.Unfold
687− import: test-options
688− type: exitcode-stdio-1.0
689− main-is: Streamly/Test/Data/Unfold.hs
690− hs-source-dirs: test
691−
692−test-suite Data.Parser
693− import: test-options
694− ghc-options: -O2
695− type: exitcode-stdio-1.0
696− main-is: Streamly/Test/Data/Parser.hs
697− other-modules: Streamly.Test.Common
698−
699−test-suite Data.Parser.ParserD
700− import: test-options
701− type: exitcode-stdio-1.0
702− main-is: Streamly/Test/Data/Parser/ParserD.hs
703− other-modules: Streamly.Test.Common
704−
705−test-suite Data.Array
706− import: test-options
707− type: exitcode-stdio-1.0
708− main-is: Streamly/Test/Data/Array.hs
709− ghc-options: -main-is Streamly.Test.Data.Array.main
710−
711−test-suite Data.SmallArray
712− import: test-options
713− type: exitcode-stdio-1.0
714− main-is: Streamly/Test/Data/SmallArray.hs
715− ghc-options: -main-is Streamly.Test.Data.SmallArray.main
716−
717−test-suite Data.Array.Prim
718− import: test-options
719− type: exitcode-stdio-1.0
720− main-is: Streamly/Test/Data/Array/Prim.hs
721− ghc-options: -main-is Streamly.Test.Data.Array.Prim.main
722−
723−test-suite Data.Array.Prim.Pinned
724− import: test-options
725− type: exitcode-stdio-1.0
726− main-is: Streamly/Test/Data/Array/Prim/Pinned.hs
727− ghc-options: -main-is Streamly.Test.Data.Array.Prim.Pinned.main
728−
729−test-suite Unicode.Stream
730− import: test-options
731− type: exitcode-stdio-1.0
732− main-is: Streamly/Test/Unicode/Stream.hs
733− ghc-options: -main-is Streamly.Test.Unicode.Stream.main
734−
735−test-suite version-bounds
736− import: test-options
737− type: exitcode-stdio-1.0
738− main-is: version-bounds.hs
739−
740−test-suite FileSystem.Event
741− import: test-options
742− type: exitcode-stdio-1.0
743− main-is: Streamly/Test/FileSystem/Event.hs
744− hs-source-dirs: test
745− default-language: Haskell2010
746− if os(darwin)
747− buildable: False
test/README.mdnew file+80
@@ -0,0 +1,80 @@
1+## Build a single test
2+
3+```
4+$ cabal build test:Prelude.Serial
5+```
6+
7+or:
8+
9+```
10+$ cd test; cabal build Prelude.Serial
11+```
12+
13+Build with optimizations:
14+
15+```
16+$ cabal build --flag opt ...
17+```
18+
19+## Build all tests
20+
21+```
22+$ cabal build --enable-tests all
23+```
24+
25+or:
26+
27+```
28+$ cd test; cabal build --enable-tests
29+```
30+
31+Or this, note this command does not work as expected when in the "test" dir:
32+
33+```
34+$ cabal build --enable-tests streamly-tests
35+```
36+
37+## Build and run
38+
39+Running all test suites, use any of the following:
40+
41+```
42+$ cabal test all
43+```
44+
45+or:
46+
47+```
48+$ cd test; cabal test
49+```
50+
51+Or this, note this command does not work as expected when in the "test" dir:
52+
53+```
54+$ cabal test streamly-tests
55+```
56+
57+## Build and Run a single test suite
58+
59+To run `Prelude.Serial` test-suite:
60+
61+```
62+$ cabal run test:Prelude.Serial
63+```
64+
65+or:
66+
67+```
68+$ cd test; cabal run Prelude.Serial
69+```
70+
71+Note you could use `cabal test Prelude.Serial` but that unfortunately builds
72+all the test suites before running `Prelude.Serial`.
73+
74+## Naming of test modules
75+
76+Tests are organized by source modules. For example, for the source
77+module `Streamly.Data.Array` and `Streamly.Internal.Data.Array` we have
78+a test module `Data.Array`. For some modules tests for a source module
79+are broken into multiple modules. For example, for `Streamly.Prelude` we have
80+`Streamly.Prelude.Serial`, `Streamly.Prelude.Async` etc.
test/Streamly/Test/Common.hs → test/lib/Streamly/Test/Common.hsrenamed

The content is the same.

test/Streamly/Test/Prelude/Common.hs → test/lib/Streamly/Test/Prelude/Common.hsrenamed

The content is the same.

test/streamly-tests.cabalnew file+327
@@ -0,0 +1,327 @@
1+cabal-version: 2.2
2+name: streamly-tests
3+version: 0.0.0
4+synopsis: Tests for streamly
5+description: See streamly-benchmarks for the reason why we use a separate
6+ package for tests.
7+
8+flag fusion-plugin
9+ description: Use fusion plugin for benchmarks and executables
10+ manual: True
11+ default: False
12+
13+flag dev
14+ description: Development build
15+ manual: True
16+ default: False
17+
18+flag has-llvm
19+ description: Use llvm backend for better performance
20+ manual: True
21+ default: False
22+
23+flag opt
24+ description: off=-O0 (faster builds), on=-O2
25+ manual: True
26+ default: True
27+
28+-------------------------------------------------------------------------------
29+-- Common stanzas
30+-------------------------------------------------------------------------------
31+
32+common compile-options
33+ default-language: Haskell2010
34+
35+ if os(darwin)
36+ cpp-options: -DCABAL_OS_DARWIN
37+
38+ if os(linux)
39+ cpp-options: -DCABAL_OS_LINUX
40+
41+ if os(windows)
42+ cpp-options: -DCABAL_OS_WINDOWS
43+
44+ if flag(dev)
45+ cpp-options: -DDEVBUILD
46+
47+ ghc-options: -Wall
48+ -Wcompat
49+ -Wunrecognised-warning-flags
50+ -Widentities
51+ -Wincomplete-record-updates
52+ -Wincomplete-uni-patterns
53+ -Wredundant-constraints
54+ -Wnoncanonical-monad-instances
55+ -Rghc-timing
56+
57+ if flag(has-llvm)
58+ ghc-options: -fllvm
59+
60+ if flag(dev)
61+ ghc-options: -Wmissed-specialisations
62+ -Wall-missed-specialisations
63+
64+ ghc-options: -fno-ignore-asserts
65+
66+common default-extensions
67+ default-extensions:
68+ BangPatterns
69+ CApiFFI
70+ CPP
71+ ConstraintKinds
72+ DeriveDataTypeable
73+ DeriveGeneric
74+ DeriveTraversable
75+ ExistentialQuantification
76+ FlexibleContexts
77+ FlexibleInstances
78+ GeneralizedNewtypeDeriving
79+ InstanceSigs
80+ KindSignatures
81+ LambdaCase
82+ MagicHash
83+ MultiParamTypeClasses
84+ PatternSynonyms
85+ RankNTypes
86+ RecordWildCards
87+ ScopedTypeVariables
88+ TupleSections
89+ TypeFamilies
90+ ViewPatterns
91+
92+ -- MonoLocalBinds, enabled by TypeFamilies, causes performance
93+ -- regressions. Disable it. This must come after TypeFamilies,
94+ -- otherwise TypeFamilies will enable it again.
95+ NoMonoLocalBinds
96+
97+ -- UndecidableInstances -- Does not show any perf impact
98+ -- UnboxedTuples -- interferes with (#.)
99+
100+common threading-options
101+ ghc-options: -threaded
102+ -with-rtsopts=-N
103+
104+common optimization-options
105+ if flag(opt)
106+ ghc-options: -O2
107+ -fdicts-strict
108+ -fmax-worker-args=16
109+ -fspec-constr-recursive=16
110+ if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
111+ ghc-options: -fplugin Fusion.Plugin
112+ else
113+ ghc-options: -O0
114+
115+common test-dependencies
116+ build-depends:
117+ streamly
118+ , base >= 4.9 && < 5
119+ , containers >= 0.5 && < 0.7
120+ , exceptions >= 0.8 && < 0.11
121+ , ghc
122+ , hspec >= 2.0 && < 3
123+ , mtl >= 2.2 && < 3
124+ , random >= 1.0.0 && < 2
125+ , transformers >= 0.4 && < 0.6
126+ , QuickCheck >= 2.13 && < 2.15
127+ , directory >= 1.2.2 && < 1.4
128+ , filepath >= 1.4.1 && < 1.5
129+ , temporary >= 1.3 && < 1.4
130+
131+ if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
132+ build-depends:
133+ fusion-plugin >= 0.2 && < 0.3
134+
135+-------------------------------------------------------------------------------
136+-- Library
137+-------------------------------------------------------------------------------
138+
139+common lib-options
140+ import: compile-options
141+ , optimization-options
142+ , threading-options
143+ , default-extensions
144+ , test-dependencies
145+
146+library
147+ import: lib-options, test-dependencies
148+ hs-source-dirs: lib
149+ exposed-modules: Streamly.Test.Common
150+ , Streamly.Test.Prelude.Common
151+
152+-------------------------------------------------------------------------------
153+-- Test suites
154+-------------------------------------------------------------------------------
155+
156+common test-options
157+ import: lib-options
158+ include-dirs: .
159+ build-depends: streamly-tests
160+
161+common always-optimized
162+ import: compile-options
163+ , threading-options
164+ , default-extensions
165+ , test-dependencies
166+ ghc-options: -O2
167+ -fdicts-strict
168+ -fmax-worker-args=16
169+ -fspec-constr-recursive=16
170+ if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
171+ ghc-options: -fplugin Fusion.Plugin
172+
173+test-suite Data.List.Base
174+ import: test-options
175+ type: exitcode-stdio-1.0
176+ main-is: Streamly/Test/Data/List.hs
177+
178+test-suite Data.List
179+ import: test-options
180+ type: exitcode-stdio-1.0
181+ main-is: Streamly/Test/Data/List.hs
182+ cpp-options: -DUSE_STREAMLY_LIST
183+
184+test-suite Prelude
185+ import: test-options
186+ type: exitcode-stdio-1.0
187+ main-is: Streamly/Test/Prelude.hs
188+ ghc-options: -main-is Streamly.Test.Prelude.main
189+
190+test-suite Prelude.Serial
191+ import: test-options
192+ type: exitcode-stdio-1.0
193+ main-is: Streamly/Test/Prelude/Serial.hs
194+ ghc-options: -main-is Streamly.Test.Prelude.Serial.main
195+
196+test-suite Prelude.WSerial
197+ import: test-options
198+ type: exitcode-stdio-1.0
199+ main-is: Streamly/Test/Prelude/WSerial.hs
200+ ghc-options: -main-is Streamly.Test.Prelude.WSerial.main
201+
202+test-suite Prelude.ZipSerial
203+ import: test-options
204+ type: exitcode-stdio-1.0
205+ main-is: Streamly/Test/Prelude/ZipSerial.hs
206+ ghc-options: -main-is Streamly.Test.Prelude.ZipSerial.main
207+
208+test-suite Prelude.ZipAsync
209+ import: test-options
210+ type: exitcode-stdio-1.0
211+ main-is: Streamly/Test/Prelude/ZipAsync.hs
212+ ghc-options: -main-is Streamly.Test.Prelude.ZipAsync.main
213+
214+test-suite Prelude.Ahead
215+ import: test-options
216+ type: exitcode-stdio-1.0
217+ main-is: Streamly/Test/Prelude/Ahead.hs
218+ ghc-options: -main-is Streamly.Test.Prelude.Ahead.main
219+
220+test-suite Prelude.Async
221+ import: test-options
222+ type: exitcode-stdio-1.0
223+ main-is: Streamly/Test/Prelude/Async.hs
224+ ghc-options: -main-is Streamly.Test.Prelude.Async.main
225+
226+test-suite Prelude.WAsync
227+ import: test-options
228+ type: exitcode-stdio-1.0
229+ main-is: Streamly/Test/Prelude/WAsync.hs
230+ ghc-options: -main-is Streamly.Test.Prelude.WAsync.main
231+
232+test-suite Prelude.Parallel
233+ import: test-options
234+ type: exitcode-stdio-1.0
235+ main-is: Streamly/Test/Prelude/Parallel.hs
236+ ghc-options: -main-is Streamly.Test.Prelude.Parallel.main
237+
238+test-suite Prelude.Concurrent
239+ import: test-options
240+ type: exitcode-stdio-1.0
241+ main-is: Streamly/Test/Prelude/Concurrent.hs
242+ ghc-options: -main-is Streamly.Test.Prelude.Concurrent.main
243+
244+test-suite Prelude.Fold
245+ import: test-options
246+ type: exitcode-stdio-1.0
247+ main-is: Streamly/Test/Prelude/Fold.hs
248+ ghc-options: -main-is Streamly.Test.Prelude.Fold.main
249+
250+test-suite Prelude.MaxRate
251+ import:always-optimized
252+ type: exitcode-stdio-1.0
253+ main-is: Streamly/Test/Prelude/MaxRate.hs
254+ ghc-options: -main-is Streamly.Test.Prelude.MaxRate.main
255+ if flag(dev)
256+ buildable: True
257+ else
258+ buildable: False
259+
260+test-suite Data.Array.Storable.Foreign
261+ import: test-options
262+ type: exitcode-stdio-1.0
263+ main-is: Streamly/Test/Data/Array/Storable/Foreign.hs
264+ ghc-options: -main-is Streamly.Test.Data.Array.Storable.Foreign.main
265+
266+test-suite Data.Fold
267+ import: test-options
268+ type: exitcode-stdio-1.0
269+ main-is: Streamly/Test/Data/Fold.hs
270+
271+test-suite Data.Unfold
272+ import: test-options
273+ type: exitcode-stdio-1.0
274+ main-is: Streamly/Test/Data/Unfold.hs
275+
276+test-suite Data.Parser
277+ import: test-options
278+ ghc-options: -O2
279+ type: exitcode-stdio-1.0
280+ main-is: Streamly/Test/Data/Parser.hs
281+
282+test-suite Data.Parser.ParserD
283+ import: test-options
284+ type: exitcode-stdio-1.0
285+ main-is: Streamly/Test/Data/Parser/ParserD.hs
286+
287+test-suite Data.Array
288+ import: test-options
289+ type: exitcode-stdio-1.0
290+ main-is: Streamly/Test/Data/Array.hs
291+ ghc-options: -main-is Streamly.Test.Data.Array.main
292+
293+test-suite Data.SmallArray
294+ import: test-options
295+ type: exitcode-stdio-1.0
296+ main-is: Streamly/Test/Data/SmallArray.hs
297+ ghc-options: -main-is Streamly.Test.Data.SmallArray.main
298+
299+test-suite Data.Array.Prim
300+ import: test-options
301+ type: exitcode-stdio-1.0
302+ main-is: Streamly/Test/Data/Array/Prim.hs
303+ ghc-options: -main-is Streamly.Test.Data.Array.Prim.main
304+
305+test-suite Data.Array.Prim.Pinned
306+ import: test-options
307+ type: exitcode-stdio-1.0
308+ main-is: Streamly/Test/Data/Array/Prim/Pinned.hs
309+ ghc-options: -main-is Streamly.Test.Data.Array.Prim.Pinned.main
310+
311+test-suite Unicode.Stream
312+ import: test-options
313+ type: exitcode-stdio-1.0
314+ main-is: Streamly/Test/Unicode/Stream.hs
315+ ghc-options: -main-is Streamly.Test.Unicode.Stream.main
316+
317+test-suite version-bounds
318+ import: test-options
319+ type: exitcode-stdio-1.0
320+ main-is: version-bounds.hs
321+
322+test-suite FileSystem.Event
323+ import: test-options
324+ type: exitcode-stdio-1.0
325+ main-is: Streamly/Test/FileSystem/Event.hs
326+ if os(darwin)
327+ buildable: False