mirror of
https://github.com/ilyakooo0/streamly.git
synced 2024-09-11 08:25:40 +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
|
# Other
|
||||||
.log
|
.log
|
||||||
|
_doctests/
|
||||||
|
4
Setup.hs
4
Setup.hs
@ -1,6 +1,6 @@
|
|||||||
module Main (main) where
|
module Main (main) where
|
||||||
|
|
||||||
import Distribution.Simple
|
import Distribution.Extra.Doctest (defaultMainAutoconfWithDoctests)
|
||||||
|
|
||||||
main :: IO ()
|
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
|
copyright: 2017 Composewell Technologies
|
||||||
category: Control, Concurrency, Streaming, Reactivity
|
category: Control, Concurrency, Streaming, Reactivity
|
||||||
stability: Experimental
|
stability: Experimental
|
||||||
build-type: Configure
|
build-type: Custom
|
||||||
|
|
||||||
extra-source-files:
|
extra-source-files:
|
||||||
.circleci/config.yml
|
.circleci/config.yml
|
||||||
@ -238,6 +238,16 @@ flag opt
|
|||||||
manual: True
|
manual: True
|
||||||
default: 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
|
-- Common stanzas
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
@ -570,3 +580,19 @@ library
|
|||||||
-- tests fail
|
-- tests fail
|
||||||
if flag(dev) && flag(inspection)
|
if flag(dev) && flag(inspection)
|
||||||
build-depends: inspection-and-dev-flags-cannot-be-used-together
|
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