on master help sign in
Use a common-stanza for test dependencies.
987a19fpranaysashank
streamly.cabal+28−126
@@ -320,11 +320,25 @@ common threading-options
320common lib-options
320common lib-options
321 import: compile-options, optimization-options, default-extensions
321 import: compile-options, optimization-options, default-extensions
322
322
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+
323-- Compilation for coverage builds on CI machines takes too long without -O0
336-- Compilation for coverage builds on CI machines takes too long without -O0
324-- XXX we should use coverage flag for that, -O0 may take too long to run tests
337-- XXX we should use coverage flag for that, -O0 may take too long to run tests
325-- in general.
338-- in general.
326common test-options
339common test-options
327 import: compile-options, threading-options, default-extensions
340 import: compile-options, threading-options, default-extensions
341+ ,test-dependencies
328
342
329 ghc-options: -O0
343 ghc-options: -O0
330 -fno-ignore-asserts
344 -fno-ignore-asserts
@@ -334,15 +348,8 @@ common test-options
334 -- build-depends:
348 -- build-depends:
335 -- fusion-plugin >= 0.2 && < 0.3
349 -- fusion-plugin >= 0.2 && < 0.3
336
350
337−common prelude-test-options
338− js-sources: jsbits/clock.js
339 hs-source-dirs: test
351 hs-source-dirs: test
340− build-depends:
352+ js-sources: jsbits/clock.js
341− streamly
342− , base >= 4.9 && < 5
343− , QuickCheck >= 2.13 && < 2.15
344− , hspec >= 2.0 && < 3
345− , exceptions >= 0.8 && < 0.11
346 default-language: Haskell2010
353 default-language: Haskell2010
347
354
348-- Used by maxrate test, benchmarks and executables
355-- Used by maxrate test, benchmarks and executables
@@ -562,38 +569,21 @@ test-suite Data.List
562 import: test-options
569 import: test-options
563 type: exitcode-stdio-1.0
570 type: exitcode-stdio-1.0
564 main-is: Streamly/Test/Data/List.hs
571 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
571
572
572test-suite Streamly.Test.Data.List
573test-suite Streamly.Test.Data.List
573 import: test-options
574 import: test-options
574 type: exitcode-stdio-1.0
575 type: exitcode-stdio-1.0
575 main-is: Streamly/Test/Data/List.hs
576 main-is: Streamly/Test/Data/List.hs
576− hs-source-dirs: test
577 cpp-options: -DUSE_STREAMLY_LIST
577 cpp-options: -DUSE_STREAMLY_LIST
578− build-depends:
579− streamly
580− , base >= 4.9 && < 5
581− , hspec >= 2.0 && < 3
582− default-language: Haskell2010
583
578
584test-suite Prelude
579test-suite Prelude
585− import: test-options, prelude-test-options
580+ import: test-options
586 type: exitcode-stdio-1.0
581 type: exitcode-stdio-1.0
587 main-is: Streamly/Test/Prelude.hs
582 main-is: Streamly/Test/Prelude.hs
588 ghc-options: -main-is Streamly.Test.Prelude.main
583 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
594
584
595test-suite Prelude.Serial
585test-suite Prelude.Serial
596− import: test-options, prelude-test-options
586+ import: test-options
597 type: exitcode-stdio-1.0
587 type: exitcode-stdio-1.0
598 main-is: Streamly/Test/Prelude/Serial.hs
588 main-is: Streamly/Test/Prelude/Serial.hs
599 ghc-options: -main-is Streamly.Test.Prelude.Serial.main
589 ghc-options: -main-is Streamly.Test.Prelude.Serial.main
@@ -601,7 +591,7 @@ test-suite Prelude.Serial
601 , Streamly.Test.Prelude.Common
591 , Streamly.Test.Prelude.Common
602
592
603test-suite Prelude.WSerial
593test-suite Prelude.WSerial
604− import: test-options, prelude-test-options
594+ import: test-options
605 type: exitcode-stdio-1.0
595 type: exitcode-stdio-1.0
606 main-is: Streamly/Test/Prelude/WSerial.hs
596 main-is: Streamly/Test/Prelude/WSerial.hs
607 ghc-options: -main-is Streamly.Test.Prelude.WSerial.main
597 ghc-options: -main-is Streamly.Test.Prelude.WSerial.main
@@ -609,7 +599,7 @@ test-suite Prelude.WSerial
609 , Streamly.Test.Prelude.Common
599 , Streamly.Test.Prelude.Common
610
600
611test-suite Prelude.ZipSerial
601test-suite Prelude.ZipSerial
612− import: test-options, prelude-test-options
602+ import: test-options
613 type: exitcode-stdio-1.0
603 type: exitcode-stdio-1.0
614 main-is: Streamly/Test/Prelude/ZipSerial.hs
604 main-is: Streamly/Test/Prelude/ZipSerial.hs
615 ghc-options: -main-is Streamly.Test.Prelude.ZipSerial.main
605 ghc-options: -main-is Streamly.Test.Prelude.ZipSerial.main
@@ -617,7 +607,7 @@ test-suite Prelude.ZipSerial
617 , Streamly.Test.Prelude.Common
607 , Streamly.Test.Prelude.Common
618
608
619test-suite Prelude.ZipAsync
609test-suite Prelude.ZipAsync
620− import: test-options, prelude-test-options
610+ import: test-options
621 type: exitcode-stdio-1.0
611 type: exitcode-stdio-1.0
622 main-is: Streamly/Test/Prelude/ZipAsync.hs
612 main-is: Streamly/Test/Prelude/ZipAsync.hs
623 ghc-options: -main-is Streamly.Test.Prelude.ZipAsync.main
613 ghc-options: -main-is Streamly.Test.Prelude.ZipAsync.main
@@ -625,7 +615,7 @@ test-suite Prelude.ZipAsync
625 , Streamly.Test.Prelude.Common
615 , Streamly.Test.Prelude.Common
626
616
627test-suite Prelude.Ahead
617test-suite Prelude.Ahead
628− import: test-options, prelude-test-options
618+ import: test-options
629 type: exitcode-stdio-1.0
619 type: exitcode-stdio-1.0
630 main-is: Streamly/Test/Prelude/Ahead.hs
620 main-is: Streamly/Test/Prelude/Ahead.hs
631 ghc-options: -main-is Streamly.Test.Prelude.Ahead.main
621 ghc-options: -main-is Streamly.Test.Prelude.Ahead.main
@@ -633,7 +623,7 @@ test-suite Prelude.Ahead
633 , Streamly.Test.Prelude.Common
623 , Streamly.Test.Prelude.Common
634
624
635test-suite Prelude.Async
625test-suite Prelude.Async
636− import: test-options, prelude-test-options
626+ import: test-options
637 type: exitcode-stdio-1.0
627 type: exitcode-stdio-1.0
638 main-is: Streamly/Test/Prelude/Async.hs
628 main-is: Streamly/Test/Prelude/Async.hs
639 ghc-options: -main-is Streamly.Test.Prelude.Async.main
629 ghc-options: -main-is Streamly.Test.Prelude.Async.main
@@ -641,7 +631,7 @@ test-suite Prelude.Async
641 , Streamly.Test.Prelude.Common
631 , Streamly.Test.Prelude.Common
642
632
643test-suite Prelude.WAsync
633test-suite Prelude.WAsync
644− import: test-options, prelude-test-options
634+ import: test-options
645 type: exitcode-stdio-1.0
635 type: exitcode-stdio-1.0
646 main-is: Streamly/Test/Prelude/WAsync.hs
636 main-is: Streamly/Test/Prelude/WAsync.hs
647 ghc-options: -main-is Streamly.Test.Prelude.WAsync.main
637 ghc-options: -main-is Streamly.Test.Prelude.WAsync.main
@@ -649,7 +639,7 @@ test-suite Prelude.WAsync
649 , Streamly.Test.Prelude.Common
639 , Streamly.Test.Prelude.Common
650
640
651test-suite Prelude.Parallel
641test-suite Prelude.Parallel
652− import: test-options, prelude-test-options
642+ import: test-options
653 type: exitcode-stdio-1.0
643 type: exitcode-stdio-1.0
654 main-is: Streamly/Test/Prelude/Parallel.hs
644 main-is: Streamly/Test/Prelude/Parallel.hs
655 ghc-options: -main-is Streamly.Test.Prelude.Parallel.main
645 ghc-options: -main-is Streamly.Test.Prelude.Parallel.main
@@ -657,7 +647,7 @@ test-suite Prelude.Parallel
657 , Streamly.Test.Prelude.Common
647 , Streamly.Test.Prelude.Common
658
648
659test-suite Prelude.Concurrent
649test-suite Prelude.Concurrent
660− import: test-options, prelude-test-options
650+ import: test-options
661 type: exitcode-stdio-1.0
651 type: exitcode-stdio-1.0
662 main-is: Streamly/Test/Prelude/Concurrent.hs
652 main-is: Streamly/Test/Prelude/Concurrent.hs
663 ghc-options: -main-is Streamly.Test.Prelude.Concurrent.main
653 ghc-options: -main-is Streamly.Test.Prelude.Concurrent.main
@@ -666,7 +656,7 @@ test-suite Prelude.Concurrent
666 build-depends: mtl >= 2.2 && < 3
656 build-depends: mtl >= 2.2 && < 3
667
657
668test-suite Prelude.Fold
658test-suite Prelude.Fold
669− import: test-options, prelude-test-options
659+ import: test-options
670 type: exitcode-stdio-1.0
660 type: exitcode-stdio-1.0
671 main-is: Streamly/Test/Prelude/Fold.hs
661 main-is: Streamly/Test/Prelude/Fold.hs
672 ghc-options: -main-is Streamly.Test.Prelude.Fold.main
662 ghc-options: -main-is Streamly.Test.Prelude.Fold.main
@@ -674,13 +664,12 @@ test-suite Prelude.Fold
674 , Streamly.Test.Prelude.Common
664 , Streamly.Test.Prelude.Common
675
665
676test-suite Prelude.MaxRate
666test-suite Prelude.MaxRate
677− import: prelude-test-options, exe-options, default-extensions
667+ import: test-options, exe-options
678 type: exitcode-stdio-1.0
668 type: exitcode-stdio-1.0
679 main-is: Streamly/Test/Prelude/MaxRate.hs
669 main-is: Streamly/Test/Prelude/MaxRate.hs
680 ghc-options: -main-is Streamly.Test.Prelude.MaxRate.main
670 ghc-options: -main-is Streamly.Test.Prelude.MaxRate.main
681 if flag(dev)
671 if flag(dev)
682 buildable: True
672 buildable: True
683− build-depends: random >= 1.0.0 && < 2
684 else
673 else
685 buildable: False
674 buildable: False
686
675
@@ -688,131 +677,55 @@ test-suite array-test
688 import: test-options
677 import: test-options
689 type: exitcode-stdio-1.0
678 type: exitcode-stdio-1.0
690 main-is: Streamly/Test/Array.hs
679 main-is: Streamly/Test/Array.hs
691− js-sources: jsbits/clock.js
692− hs-source-dirs: test
693 cpp-options: -DTEST_ARRAY
680 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
700
681
701test-suite internal-data-fold-test
682test-suite internal-data-fold-test
702 import: test-options
683 import: test-options
703 type: exitcode-stdio-1.0
684 type: exitcode-stdio-1.0
704 main-is: Streamly/Test/Internal/Data/Fold.hs
685 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
713
686
714test-suite Data.Unfold
687test-suite Data.Unfold
715 import: test-options
688 import: test-options
716 type: exitcode-stdio-1.0
689 type: exitcode-stdio-1.0
717 main-is: Streamly/Test/Data/Unfold.hs
690 main-is: Streamly/Test/Data/Unfold.hs
718− js-sources: jsbits/clock.js
719 hs-source-dirs: test
691 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
727
692
728test-suite internal-data-parser-test
693test-suite internal-data-parser-test
729 import: test-options
694 import: test-options
730 ghc-options: -O2
695 ghc-options: -O2
731 type: exitcode-stdio-1.0
696 type: exitcode-stdio-1.0
732 main-is: Streamly/Test/Data/Parser.hs
697 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
743
698
744test-suite internal-data-parser-parserd-test
699test-suite internal-data-parser-parserd-test
745 import: test-options
700 import: test-options
746 type: exitcode-stdio-1.0
701 type: exitcode-stdio-1.0
747 main-is: Streamly/Test/Data/Parser/ParserD.hs
702 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
758
703
759test-suite data-array-test
704test-suite data-array-test
760 import: test-options
705 import: test-options
761 type: exitcode-stdio-1.0
706 type: exitcode-stdio-1.0
762 main-is: Streamly/Test/Array.hs
707 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
771
708
772test-suite smallarray-test
709test-suite smallarray-test
773 import: test-options
710 import: test-options
774 type: exitcode-stdio-1.0
711 type: exitcode-stdio-1.0
775 main-is: Streamly/Test/Array.hs
712 main-is: Streamly/Test/Array.hs
776− js-sources: jsbits/clock.js
777− hs-source-dirs: test
778 cpp-options: -DTEST_SMALL_ARRAY
713 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
785
714
786test-suite primarray-test
715test-suite primarray-test
787 import: test-options
716 import: test-options
788 type: exitcode-stdio-1.0
717 type: exitcode-stdio-1.0
789 main-is: Streamly/Test/Array.hs
718 main-is: Streamly/Test/Array.hs
790− js-sources: jsbits/clock.js
791− hs-source-dirs: test
792 cpp-options: -DDATA_ARRAY_PRIM
719 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
799
720
800test-suite prim-pinned-array-test
721test-suite prim-pinned-array-test
801 import: test-options
722 import: test-options
802 type: exitcode-stdio-1.0
723 type: exitcode-stdio-1.0
803 main-is: Streamly/Test/Array.hs
724 main-is: Streamly/Test/Array.hs
804− js-sources: jsbits/clock.js
805− hs-source-dirs: test
806 cpp-options: -DDATA_ARRAY_PRIM_PINNED
725 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
813
726
814test-suite Streamly.Test.Unicode.Stream
727test-suite Streamly.Test.Unicode.Stream
815− import: test-options, prelude-test-options
728+ import: test-options
816 type: exitcode-stdio-1.0
729 type: exitcode-stdio-1.0
817 main-is: Streamly/Test/Unicode/Stream.hs
730 main-is: Streamly/Test/Unicode/Stream.hs
818 ghc-options: -main-is Streamly.Test.Unicode.Stream.main
731 ghc-options: -main-is Streamly.Test.Unicode.Stream.main
@@ -820,22 +733,11 @@ test-suite Streamly.Test.Unicode.Stream
820test-suite version-bounds
733test-suite version-bounds
821 import: test-options
734 import: test-options
822 type: exitcode-stdio-1.0
735 type: exitcode-stdio-1.0
823− default-language: Haskell2010
824 main-is: version-bounds.hs
736 main-is: version-bounds.hs
825− hs-source-dirs: test
826− build-Depends:
827− streamly
828− , ghc
829− , base >= 4.9 && < 5
830
737
831executable FileSystem.Event
738executable FileSystem.Event
832 import: test-options
739 import: test-options
833− default-language: Haskell2010
834 main-is: Streamly/Test/FileSystem/Event.hs
740 main-is: Streamly/Test/FileSystem/Event.hs
835− hs-source-dirs: test
836− build-depends:
837− streamly
838− , base >= 4.8 && < 5
839 if !flag(manual-tests)
741 if !flag(manual-tests)
840 buildable: False
742 buildable: False
841
743