From: Michael Orlitzky Date: Wed, 16 Jul 2014 15:16:13 +0000 (-0400) Subject: Add a doctest suite. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=0ed071e75268da9ba8273d5c13817fa1297c94e2;p=dead%2Fhalcyon.git Add a doctest suite. --- diff --git a/halcyon.cabal b/halcyon.cabal index a3c39bc..dfbd174 100644 --- a/halcyon.cabal +++ b/halcyon.cabal @@ -22,6 +22,7 @@ executable halcyon cmdargs >= 0.10.5, configurator >= 0.2, directory >= 1.2, + filepath >= 1.3, http-client >= 0.3, http-client-tls >= 0.2, HUnit == 1.2.*, @@ -67,6 +68,7 @@ executable halcyon -fwarn-unused-do-bind -optc-O3 -optc-march=native + -O2 test-suite testsuite type: exitcode-stdio-1.0 @@ -80,6 +82,7 @@ test-suite testsuite cmdargs >= 0.10.5, configurator >= 0.2, directory >= 1.2, + filepath >= 1.3, http-client >= 0.3, http-client-tls >= 0.2, MissingH >= 1.2, @@ -107,6 +110,37 @@ test-suite testsuite -fwarn-unused-do-bind -optc-O3 -optc-march=native + -O2 + + +test-suite doctests + type: exitcode-stdio-1.0 + hs-source-dirs: test + main-is: Doctests.hs + build-depends: + base >= 4.6 && < 5, + -- Additional test dependencies. + doctest >= 0.9, + filemanip >= 0.3 + + -- It's not entirely clear to me why I have to reproduce all of this. + ghc-options: + -Wall + -fwarn-hi-shadowing + -fwarn-missing-signatures + -fwarn-name-shadowing + -fwarn-orphans + -fwarn-type-defaults + -fwarn-tabs + -fwarn-incomplete-record-updates + -fwarn-monomorphism-restriction + -fwarn-unused-do-bind + -rtsopts + -threaded + -optc-O3 + -optc-march=native + -O2 + source-repository head type: git diff --git a/test/Doctests.hs b/test/Doctests.hs new file mode 100644 index 0000000..d183b4b --- /dev/null +++ b/test/Doctests.hs @@ -0,0 +1,13 @@ +module Main +where + +import Test.DocTest +import System.FilePath.Find ((==?), always, extension, find) + +find_sources :: IO [FilePath] +find_sources = find always (extension ==? ".hs") "src/" + +main :: IO () +main = do + sources <- find_sources + doctest $ ["-isrc", "-idist/build/autogen"] ++ sources