diff --git a/servant-server/servant-server.cabal b/servant-server/servant-server.cabal index 293cd289..330079a3 100644 --- a/servant-server/servant-server.cabal +++ b/servant-server/servant-server.cabal @@ -108,3 +108,14 @@ test-suite spec , wai , wai-extra , warp + +test-suite doctests + build-depends: base + , servant + , doctest + , filemanip + type: exitcode-stdio-1.0 + main-is: test/Doctests.hs + buildable: True + default-language: Haskell2010 + ghc-options: -threaded diff --git a/servant-server/test/Doctests.hs b/servant-server/test/Doctests.hs new file mode 100644 index 00000000..c63a6d85 --- /dev/null +++ b/servant-server/test/Doctests.hs @@ -0,0 +1,18 @@ +module Main where + +import System.FilePath.Find +import Test.DocTest + +main :: IO () +main = do + files <- find always (extension ==? ".hs") "src" + doctest $ [ "-isrc" + , "-optP-include" + , "-optPdist/build/autogen/cabal_macros.h" + , "-XOverloadedStrings" + , "-XFlexibleInstances" + , "-XMultiParamTypeClasses" + , "-XDataKinds" + , "-XTypeOperators" + ] ++ files +