From 3b4b958110db85a1eb5a99e19f7ab2561d55bac4 Mon Sep 17 00:00:00 2001 From: "Julian K. Arni" Date: Sun, 3 May 2015 01:27:48 +0200 Subject: [PATCH] Doctests for servant-server --- servant-server/servant-server.cabal | 11 +++++++++++ servant-server/test/Doctests.hs | 18 ++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 servant-server/test/Doctests.hs 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 +