on master help sign in
Use a common-stanza for test dependencies.

Closes #683

commit987a19f04d5ea553d80054461a4f0331cc39be29 authorpranaysashank <pranaysashank@composewell.com> dateMon 26 Oct 2020, 16:47 (6 years ago) parent6f4fd8d
1 file changed+28−126
streamly.cabal+28−126
streamly.cabal+28−126
@@ -320,11 +320,25 @@ common threading-options
320320common lib-options
321321 import: compile-options, optimization-options, default-extensions
322322
323+common test-dependencies
324+ build-depends:
325+ streamly
326+ , base >= 4.9 && < 5
327+ , containers >= 0.5 && < 0.7
328+ , exceptions >= 0.8 && < 0.11
329+ , ghc
330+ , hspec >= 2.0 && < 3
331+ , mtl >= 2.2 && < 3
332+ , random >= 1.0.0 && < 2
333+ , transformers >= 0.4 && < 0.6
334+ , QuickCheck >= 2.13 && < 2.15
335+
323336-- Compilation for coverage builds on CI machines takes too long without -O0
324337-- XXX we should use coverage flag for that, -O0 may take too long to run tests
325338-- in general.
326339common test-options
327340 import: compile-options, threading-options, default-extensions
341+ ,test-dependencies
328342
329343 ghc-options: -O0
330344 -fno-ignore-asserts
@@ -334,15 +348,8 @@ common test-options
334348 -- build-depends:
335349 -- fusion-plugin >= 0.2 && < 0.3
336350
337−common prelude-test-options
338− js-sources: jsbits/clock.js
339351 hs-source-dirs: test
340− build-depends:
341− streamly
342− , base >= 4.9 && < 5
343− , QuickCheck >= 2.13 && < 2.15
344− , hspec >= 2.0 && < 3
345− , exceptions >= 0.8 && < 0.11
352+ js-sources: jsbits/clock.js
346353 default-language: Haskell2010
347354
348355-- Used by maxrate test, benchmarks and executables
@@ -562,38 +569,21 @@ test-suite Data.List
562569 import: test-options
563570 type: exitcode-stdio-1.0
564571 main-is: Streamly/Test/Data/List.hs
565− hs-source-dirs: test
566− build-depends:
567− streamly
568− , base >= 4.9 && < 5
569− , hspec >= 2.0 && < 3
570− default-language: Haskell2010
571572
572573test-suite Streamly.Test.Data.List
573574 import: test-options
574575 type: exitcode-stdio-1.0
575576 main-is: Streamly/Test/Data/List.hs
576− hs-source-dirs: test
577577 cpp-options: -DUSE_STREAMLY_LIST
578− build-depends:
579− streamly
580− , base >= 4.9 && < 5
581− , hspec >= 2.0 && < 3
582− default-language: Haskell2010
583578
584579test-suite Prelude
585− import: test-options, prelude-test-options
580+ import: test-options
586581 type: exitcode-stdio-1.0
587582 main-is: Streamly/Test/Prelude.hs
588583 ghc-options: -main-is Streamly.Test.Prelude.main
589− build-depends:
590− , containers >= 0.5 && < 0.7
591− , transformers >= 0.4 && < 0.6
592− , mtl >= 2.2 && < 3
593− , random >= 1.0.0 && < 2
594584
595585test-suite Prelude.Serial
596− import: test-options, prelude-test-options
586+ import: test-options
597587 type: exitcode-stdio-1.0
598588 main-is: Streamly/Test/Prelude/Serial.hs
599589 ghc-options: -main-is Streamly.Test.Prelude.Serial.main
@@ -601,7 +591,7 @@ test-suite Prelude.Serial
601591 , Streamly.Test.Prelude.Common
602592
603593test-suite Prelude.WSerial
604− import: test-options, prelude-test-options
594+ import: test-options
605595 type: exitcode-stdio-1.0
606596 main-is: Streamly/Test/Prelude/WSerial.hs
607597 ghc-options: -main-is Streamly.Test.Prelude.WSerial.main
@@ -609,7 +599,7 @@ test-suite Prelude.WSerial
609599 , Streamly.Test.Prelude.Common
610600
611601test-suite Prelude.ZipSerial
612− import: test-options, prelude-test-options
602+ import: test-options
613603 type: exitcode-stdio-1.0
614604 main-is: Streamly/Test/Prelude/ZipSerial.hs
615605 ghc-options: -main-is Streamly.Test.Prelude.ZipSerial.main
@@ -617,7 +607,7 @@ test-suite Prelude.ZipSerial
617607 , Streamly.Test.Prelude.Common
618608
619609test-suite Prelude.ZipAsync
620− import: test-options, prelude-test-options
610+ import: test-options
621611 type: exitcode-stdio-1.0
622612 main-is: Streamly/Test/Prelude/ZipAsync.hs
623613 ghc-options: -main-is Streamly.Test.Prelude.ZipAsync.main
@@ -625,7 +615,7 @@ test-suite Prelude.ZipAsync
625615 , Streamly.Test.Prelude.Common
626616
627617test-suite Prelude.Ahead
628− import: test-options, prelude-test-options
618+ import: test-options
629619 type: exitcode-stdio-1.0
630620 main-is: Streamly/Test/Prelude/Ahead.hs
631621 ghc-options: -main-is Streamly.Test.Prelude.Ahead.main
@@ -633,7 +623,7 @@ test-suite Prelude.Ahead
633623 , Streamly.Test.Prelude.Common
634624
635625test-suite Prelude.Async
636− import: test-options, prelude-test-options
626+ import: test-options
637627 type: exitcode-stdio-1.0
638628 main-is: Streamly/Test/Prelude/Async.hs
639629 ghc-options: -main-is Streamly.Test.Prelude.Async.main
@@ -641,7 +631,7 @@ test-suite Prelude.Async
641631 , Streamly.Test.Prelude.Common
642632
643633test-suite Prelude.WAsync
644− import: test-options, prelude-test-options
634+ import: test-options
645635 type: exitcode-stdio-1.0
646636 main-is: Streamly/Test/Prelude/WAsync.hs
647637 ghc-options: -main-is Streamly.Test.Prelude.WAsync.main
@@ -649,7 +639,7 @@ test-suite Prelude.WAsync
649639 , Streamly.Test.Prelude.Common
650640
651641test-suite Prelude.Parallel
652− import: test-options, prelude-test-options
642+ import: test-options
653643 type: exitcode-stdio-1.0
654644 main-is: Streamly/Test/Prelude/Parallel.hs
655645 ghc-options: -main-is Streamly.Test.Prelude.Parallel.main
@@ -657,7 +647,7 @@ test-suite Prelude.Parallel
657647 , Streamly.Test.Prelude.Common
658648
659649test-suite Prelude.Concurrent
660− import: test-options, prelude-test-options
650+ import: test-options
661651 type: exitcode-stdio-1.0
662652 main-is: Streamly/Test/Prelude/Concurrent.hs
663653 ghc-options: -main-is Streamly.Test.Prelude.Concurrent.main
@@ -666,7 +656,7 @@ test-suite Prelude.Concurrent
666656 build-depends: mtl >= 2.2 && < 3
667657
668658test-suite Prelude.Fold
669− import: test-options, prelude-test-options
659+ import: test-options
670660 type: exitcode-stdio-1.0
671661 main-is: Streamly/Test/Prelude/Fold.hs
672662 ghc-options: -main-is Streamly.Test.Prelude.Fold.main
@@ -674,13 +664,12 @@ test-suite Prelude.Fold
674664 , Streamly.Test.Prelude.Common
675665
676666test-suite Prelude.MaxRate
677− import: prelude-test-options, exe-options, default-extensions
667+ import: test-options, exe-options
678668 type: exitcode-stdio-1.0
679669 main-is: Streamly/Test/Prelude/MaxRate.hs
680670 ghc-options: -main-is Streamly.Test.Prelude.MaxRate.main
681671 if flag(dev)
682672 buildable: True
683− build-depends: random >= 1.0.0 && < 2
684673 else
685674 buildable: False
686675
@@ -688,131 +677,55 @@ test-suite array-test
688677 import: test-options
689678 type: exitcode-stdio-1.0
690679 main-is: Streamly/Test/Array.hs
691− js-sources: jsbits/clock.js
692− hs-source-dirs: test
693680 cpp-options: -DTEST_ARRAY
694− build-depends:
695− streamly
696− , base >= 4.9 && < 5
697− , QuickCheck >= 2.13 && < 2.15
698− , hspec >= 2.0 && < 3
699− default-language: Haskell2010
700681
701682test-suite internal-data-fold-test
702683 import: test-options
703684 type: exitcode-stdio-1.0
704685 main-is: Streamly/Test/Internal/Data/Fold.hs
705− js-sources: jsbits/clock.js
706− hs-source-dirs: test
707− build-depends:
708− streamly
709− , base >= 4.9 && < 5
710− , hspec >= 2.0 && < 3
711− , QuickCheck >= 2.13 && < 2.15
712− default-language: Haskell2010
713686
714687test-suite Data.Unfold
715688 import: test-options
716689 type: exitcode-stdio-1.0
717690 main-is: Streamly/Test/Data/Unfold.hs
718− js-sources: jsbits/clock.js
719691 hs-source-dirs: test
720− build-depends:
721− streamly
722− , base >= 4.8 && < 5
723− , hspec >= 2.0 && < 3
724− , QuickCheck >= 2.13 && < 2.15
725− , transformers >= 0.4 && < 0.6
726− default-language: Haskell2010
727692
728693test-suite internal-data-parser-test
729694 import: test-options
730695 ghc-options: -O2
731696 type: exitcode-stdio-1.0
732697 main-is: Streamly/Test/Data/Parser.hs
733− js-sources: jsbits/clock.js
734− hs-source-dirs: test
735− build-depends:
736− streamly
737− , base >= 4.9 && < 5
738− , hspec >= 2.0 && < 3
739− , QuickCheck >= 2.13 && < 2.15
740− , transformers >= 0.4 && < 0.6
741− , random >= 1.0.0 && < 2
742− default-language: Haskell2010
743698
744699test-suite internal-data-parser-parserd-test
745700 import: test-options
746701 type: exitcode-stdio-1.0
747702 main-is: Streamly/Test/Data/Parser/ParserD.hs
748− js-sources: jsbits/clock.js
749− hs-source-dirs: test
750− build-depends:
751− streamly
752− , base >= 4.9 && < 5
753− , hspec >= 2.0 && < 3
754− , QuickCheck >= 2.13 && < 2.15
755− , transformers >= 0.4 && < 0.6
756− , random >= 1.0.0 && < 2
757− default-language: Haskell2010
758703
759704test-suite data-array-test
760705 import: test-options
761706 type: exitcode-stdio-1.0
762707 main-is: Streamly/Test/Array.hs
763− js-sources: jsbits/clock.js
764− hs-source-dirs: test
765− build-depends:
766− streamly
767− , base >= 4.9 && < 5
768− , QuickCheck >= 2.13 && < 2.15
769− , hspec >= 2.0 && < 3
770− default-language: Haskell2010
771708
772709test-suite smallarray-test
773710 import: test-options
774711 type: exitcode-stdio-1.0
775712 main-is: Streamly/Test/Array.hs
776− js-sources: jsbits/clock.js
777− hs-source-dirs: test
778713 cpp-options: -DTEST_SMALL_ARRAY
779− build-depends:
780− streamly
781− , base >= 4.9 && < 5
782− , QuickCheck >= 2.13 && < 2.15
783− , hspec >= 2.0 && < 3
784− default-language: Haskell2010
785714
786715test-suite primarray-test
787716 import: test-options
788717 type: exitcode-stdio-1.0
789718 main-is: Streamly/Test/Array.hs
790− js-sources: jsbits/clock.js
791− hs-source-dirs: test
792719 cpp-options: -DDATA_ARRAY_PRIM
793− build-depends:
794− streamly
795− , base >= 4.9 && < 5
796− , QuickCheck >= 2.13 && < 2.15
797− , hspec >= 2.0 && < 3
798− default-language: Haskell2010
799720
800721test-suite prim-pinned-array-test
801722 import: test-options
802723 type: exitcode-stdio-1.0
803724 main-is: Streamly/Test/Array.hs
804− js-sources: jsbits/clock.js
805− hs-source-dirs: test
806725 cpp-options: -DDATA_ARRAY_PRIM_PINNED
807− build-depends:
808− streamly
809− , base >= 4.9 && < 5
810− , QuickCheck >= 2.13 && < 2.15
811− , hspec >= 2.0 && < 3
812− default-language: Haskell2010
813726
814727test-suite Streamly.Test.Unicode.Stream
815− import: test-options, prelude-test-options
728+ import: test-options
816729 type: exitcode-stdio-1.0
817730 main-is: Streamly/Test/Unicode/Stream.hs
818731 ghc-options: -main-is Streamly.Test.Unicode.Stream.main
@@ -820,22 +733,11 @@ test-suite Streamly.Test.Unicode.Stream
820733test-suite version-bounds
821734 import: test-options
822735 type: exitcode-stdio-1.0
823− default-language: Haskell2010
824736 main-is: version-bounds.hs
825− hs-source-dirs: test
826− build-Depends:
827− streamly
828− , ghc
829− , base >= 4.9 && < 5
830737
831738executable FileSystem.Event
832739 import: test-options
833− default-language: Haskell2010
834740 main-is: Streamly/Test/FileSystem/Event.hs
835− hs-source-dirs: test
836− build-depends:
837− streamly
838− , base >= 4.8 && < 5
839741 if !flag(manual-tests)
840742 buildable: False
841743