@@ -157,7 +157,21 @@ extra-source-files:
157157 src/Streamly/Internal/FileSystem/Event/Darwin.h
158158 src/config.h.in
159159 src/inline.hs
160+ test/README.md
160161 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
161175 stack.yaml
162176
163177extra-tmp-files:
@@ -210,6 +224,11 @@ flag use-c-malloc
210224 manual: True
211225 default: False
212226
227+flag opt
228+ description: off=GHC default, on=-O2
229+ manual: True
230+ default: True
231+
213232-------------------------------------------------------------------------------
214233-- Common stanzas
215234-------------------------------------------------------------------------------
@@ -296,10 +315,11 @@ common default-extensions
296315 -- UnboxedTuples -- interferes with (#.)
297316
298317common optimization-options
299− ghc-options: -O2
300− -fdicts-strict
301− -fspec-constr-recursive=16
302− -fmax-worker-args=16
318+ if flag(opt)
319+ ghc-options: -O2
320+ -fdicts-strict
321+ -fspec-constr-recursive=16
322+ -fmax-worker-args=16
303323
304324common threading-options
305325 ghc-options: -threaded
@@ -314,50 +334,6 @@ common threading-options
314334common lib-options
315335 import: compile-options, optimization-options, default-extensions
316336
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−
361337-------------------------------------------------------------------------------
362338-- Library
363339-------------------------------------------------------------------------------
@@ -558,190 +534,3 @@ library
558534 -- tests fail
559535 if flag(dev) && flag(inspection)
560536 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