mirror of
https://github.com/ilyakooo0/streamly.git
synced 2024-08-15 11:20:22 +03:00
Add doctests test suite.
This commit is contained in:
parent
2c21267a6d
commit
c88b23e119
1
.gitignore
vendored
1
.gitignore
vendored
@ -14,3 +14,4 @@ cabal.project.local
|
||||
|
||||
# Other
|
||||
.log
|
||||
_doctests/
|
||||
|
4
Setup.hs
4
Setup.hs
@ -1,6 +1,6 @@
|
||||
module Main (main) where
|
||||
|
||||
import Distribution.Simple
|
||||
import Distribution.Extra.Doctest (defaultMainAutoconfWithDoctests)
|
||||
|
||||
main :: IO ()
|
||||
main = defaultMainWithHooks autoconfUserHooks
|
||||
main = defaultMainAutoconfWithDoctests "doctests"
|
||||
|
14
doctests.hs
Normal file
14
doctests.hs
Normal file
@ -0,0 +1,14 @@
|
||||
module Main where
|
||||
|
||||
import Build_doctests (flags, pkgs, module_sources)
|
||||
import Data.Foldable (traverse_)
|
||||
import System.Environment.Compat (unsetEnv)
|
||||
import Test.DocTest (doctest)
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
traverse_ putStrLn args
|
||||
unsetEnv "GHC_ENVIRONMENT"
|
||||
doctest args
|
||||
where
|
||||
args = flags ++ ["-outputdir=./_doctests/", "-fobject-code"] ++ pkgs ++ module_sources
|
@ -91,7 +91,7 @@ maintainer: streamly@composewell.com
|
||||
copyright: 2017 Composewell Technologies
|
||||
category: Control, Concurrency, Streaming, Reactivity
|
||||
stability: Experimental
|
||||
build-type: Configure
|
||||
build-type: Custom
|
||||
|
||||
extra-source-files:
|
||||
.circleci/config.yml
|
||||
@ -238,6 +238,16 @@ flag opt
|
||||
manual: True
|
||||
default: True
|
||||
|
||||
flag doctests
|
||||
description: Build doctests test suite
|
||||
manual: True
|
||||
default: False
|
||||
|
||||
custom-setup
|
||||
setup-depends:
|
||||
base >= 4 && <5,
|
||||
cabal-doctest >= 1 && <1.1
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- Common stanzas
|
||||
-------------------------------------------------------------------------------
|
||||
@ -570,3 +580,19 @@ library
|
||||
-- tests fail
|
||||
if flag(dev) && flag(inspection)
|
||||
build-depends: inspection-and-dev-flags-cannot-be-used-together
|
||||
|
||||
test-suite doctests
|
||||
type: exitcode-stdio-1.0
|
||||
main-is: doctests.hs
|
||||
if flag(doctests)
|
||||
build-depends:
|
||||
base
|
||||
, base-compat >=0.10.5 && <0.12
|
||||
, doctest >=0.15 && <0.18
|
||||
, streamly
|
||||
else
|
||||
buildable: False
|
||||
|
||||
ghc-options: -Wall -threaded
|
||||
hs-source-dirs: .
|
||||
default-language: Haskell2010
|
||||
|
Loading…
Reference in New Issue
Block a user