2020-12-12 08:55:53 +03:00
|
|
|
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 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
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
-- Common stanzas
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
common compile-options
|
|
|
|
default-language: Haskell2010
|
|
|
|
|
|
|
|
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
|
|
|
|
-Rghc-timing
|
|
|
|
|
|
|
|
if flag(has-llvm)
|
|
|
|
ghc-options: -fllvm
|
|
|
|
|
|
|
|
if flag(dev)
|
|
|
|
ghc-options: -Wmissed-specialisations
|
|
|
|
-Wall-missed-specialisations
|
|
|
|
|
|
|
|
ghc-options: -fno-ignore-asserts
|
|
|
|
|
|
|
|
common default-extensions
|
|
|
|
default-extensions:
|
|
|
|
BangPatterns
|
|
|
|
CApiFFI
|
|
|
|
CPP
|
|
|
|
ConstraintKinds
|
|
|
|
DeriveDataTypeable
|
|
|
|
DeriveGeneric
|
|
|
|
DeriveTraversable
|
|
|
|
ExistentialQuantification
|
|
|
|
FlexibleContexts
|
|
|
|
FlexibleInstances
|
|
|
|
GeneralizedNewtypeDeriving
|
|
|
|
InstanceSigs
|
|
|
|
KindSignatures
|
|
|
|
LambdaCase
|
|
|
|
MagicHash
|
|
|
|
MultiParamTypeClasses
|
|
|
|
PatternSynonyms
|
|
|
|
RankNTypes
|
|
|
|
RecordWildCards
|
|
|
|
ScopedTypeVariables
|
|
|
|
TupleSections
|
|
|
|
TypeFamilies
|
|
|
|
ViewPatterns
|
|
|
|
|
|
|
|
-- MonoLocalBinds, enabled by TypeFamilies, causes performance
|
|
|
|
-- regressions. Disable it. This must come after TypeFamilies,
|
|
|
|
-- otherwise TypeFamilies will enable it again.
|
|
|
|
NoMonoLocalBinds
|
|
|
|
|
|
|
|
-- UndecidableInstances -- Does not show any perf impact
|
|
|
|
-- UnboxedTuples -- interferes with (#.)
|
|
|
|
|
|
|
|
common threading-options
|
|
|
|
ghc-options: -threaded
|
|
|
|
-with-rtsopts=-N
|
|
|
|
|
|
|
|
common optimization-options
|
|
|
|
if flag(opt)
|
|
|
|
ghc-options: -O2
|
|
|
|
-fdicts-strict
|
|
|
|
-fmax-worker-args=16
|
|
|
|
-fspec-constr-recursive=16
|
|
|
|
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
|
|
|
|
, base >= 4.9 && < 5
|
|
|
|
, containers >= 0.5 && < 0.7
|
|
|
|
, exceptions >= 0.8 && < 0.11
|
|
|
|
, ghc
|
|
|
|
, hspec >= 2.0 && < 3
|
|
|
|
, mtl >= 2.2 && < 3
|
|
|
|
, random >= 1.0.0 && < 2
|
|
|
|
, transformers >= 0.4 && < 0.6
|
|
|
|
, QuickCheck >= 2.13 && < 2.15
|
|
|
|
, directory >= 1.2.2 && < 1.4
|
|
|
|
, filepath >= 1.4.1 && < 1.5
|
|
|
|
, temporary >= 1.3 && < 1.4
|
|
|
|
|
|
|
|
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.Prelude.Common
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
-- Test suites
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
common test-options
|
|
|
|
import: lib-options
|
2020-12-25 19:11:58 +03:00
|
|
|
, threading-options
|
|
|
|
ghc-options: -rtsopts
|
2020-12-12 08:55:53 +03:00
|
|
|
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
|
|
|
|
if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
|
|
|
|
ghc-options: -fplugin Fusion.Plugin
|
|
|
|
|
|
|
|
test-suite Data.List.Base
|
|
|
|
import: test-options
|
|
|
|
type: exitcode-stdio-1.0
|
|
|
|
main-is: Streamly/Test/Data/List.hs
|
|
|
|
|
|
|
|
test-suite Data.List
|
|
|
|
import: test-options
|
|
|
|
type: exitcode-stdio-1.0
|
|
|
|
main-is: Streamly/Test/Data/List.hs
|
|
|
|
cpp-options: -DUSE_STREAMLY_LIST
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2020-12-19 15:43:45 +03:00
|
|
|
test-suite Prelude.Rate
|
2020-12-12 08:55:53 +03:00
|
|
|
import:always-optimized
|
|
|
|
type: exitcode-stdio-1.0
|
2020-12-19 15:43:45 +03:00
|
|
|
main-is: Streamly/Test/Prelude/Rate.hs
|
|
|
|
ghc-options: -main-is Streamly.Test.Prelude.Rate.main
|
2020-12-12 08:55:53 +03:00
|
|
|
if flag(dev)
|
|
|
|
buildable: True
|
|
|
|
else
|
|
|
|
buildable: False
|
|
|
|
|
|
|
|
test-suite Data.Array.Storable.Foreign
|
|
|
|
import: test-options
|
|
|
|
type: exitcode-stdio-1.0
|
|
|
|
main-is: Streamly/Test/Data/Array/Storable/Foreign.hs
|
|
|
|
ghc-options: -main-is Streamly.Test.Data.Array.Storable.Foreign.main
|
|
|
|
|
|
|
|
test-suite Data.Fold
|
|
|
|
import: test-options
|
|
|
|
type: exitcode-stdio-1.0
|
|
|
|
main-is: Streamly/Test/Data/Fold.hs
|
|
|
|
|
|
|
|
test-suite Data.Unfold
|
|
|
|
import: test-options
|
|
|
|
type: exitcode-stdio-1.0
|
|
|
|
main-is: Streamly/Test/Data/Unfold.hs
|
|
|
|
|
|
|
|
test-suite Data.Parser
|
|
|
|
import: test-options
|
|
|
|
ghc-options: -O2
|
|
|
|
type: exitcode-stdio-1.0
|
|
|
|
main-is: Streamly/Test/Data/Parser.hs
|
|
|
|
|
|
|
|
test-suite Data.Parser.ParserD
|
|
|
|
import: test-options
|
|
|
|
type: exitcode-stdio-1.0
|
|
|
|
main-is: Streamly/Test/Data/Parser/ParserD.hs
|
|
|
|
|
|
|
|
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.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
|
|
|
|
|
|
|
|
test-suite Data.Array.Prim
|
|
|
|
import: test-options
|
|
|
|
type: exitcode-stdio-1.0
|
|
|
|
main-is: Streamly/Test/Data/Array/Prim.hs
|
|
|
|
ghc-options: -main-is Streamly.Test.Data.Array.Prim.main
|
|
|
|
|
|
|
|
test-suite Data.Array.Prim.Pinned
|
|
|
|
import: test-options
|
|
|
|
type: exitcode-stdio-1.0
|
|
|
|
main-is: Streamly/Test/Data/Array/Prim/Pinned.hs
|
|
|
|
ghc-options: -main-is Streamly.Test.Data.Array.Prim.Pinned.main
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
test-suite version-bounds
|
|
|
|
import: test-options
|
|
|
|
type: exitcode-stdio-1.0
|
|
|
|
main-is: version-bounds.hs
|
|
|
|
|
|
|
|
test-suite FileSystem.Event
|
|
|
|
import: test-options
|
|
|
|
type: exitcode-stdio-1.0
|
|
|
|
main-is: Streamly/Test/FileSystem/Event.hs
|
|
|
|
if os(darwin)
|
|
|
|
buildable: False
|