Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use Doctest to test examples in Haddock comments

  • Loading branch information...
commit 1e7b1eeb26474bff267123a6b3eb73c631b3a4b6 1 parent 7e4c554
@sol sol authored
Showing with 29 additions and 0 deletions.
  1. +6 −0 .travis.yml
  2. +7 −0 lens.cabal
  3. +16 −0 test/doctests.hs
View
6 .travis.yml
@@ -1 +1,7 @@
language: haskell
+
+install:
+ - cabal update && cabal install --enable-tests
+
+script:
+ - cabal test
View
7 lens.cabal
@@ -220,3 +220,10 @@ library
ghc-options: -Wall -fwarn-tabs -O2 -fdicts-cheap -funbox-strict-fields
hs-source-dirs: src
+
+test-suite doctests
+ main-is: doctests.hs
+ type: exitcode-stdio-1.0
+ ghc-options: -Wall -Werror -threaded
+ hs-source-dirs: test
+ build-depends: base, doctest >= 0.8
View
16 test/doctests.hs
@@ -0,0 +1,16 @@
+module Main where
+
+import Test.DocTest
+
+main :: IO ()
+main = doctest [
+ "-isrc"
+ , "-idist/build/autogen"
+ , "-optP-include", "-optPdist/build/autogen/cabal_macros.h"
+ , "src/Control/Lens.hs"
+ , "src/Data/IntMap/Lens.hs"
+ , "src/Data/IntSet/Lens.hs"
+ , "src/Data/List/Lens.hs"
+ , "src/Data/Map/Lens.hs"
+ , "src/Data/Set/Lens.hs"
+ ]
Please sign in to comment.
Something went wrong with that request. Please try again.