aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Herklotz <git@ymhg.org>2019-04-01 10:52:06 +0100
committerYann Herklotz <git@ymhg.org>2019-04-01 10:52:06 +0100
commitce3b5a9dc47c2325e1e9cc61279972048b9fbabd (patch)
treec8247d727328cc9c4c811b7778901c36b9c95274
parentec33825c477eeaa7dca196f21b1de5b0579a3106 (diff)
downloadverismith-ce3b5a9dc47c2325e1e9cc61279972048b9fbabd.tar.gz
verismith-ce3b5a9dc47c2325e1e9cc61279972048b9fbabd.zip
Add back fixed doctest
-rw-r--r--Setup.hs6
-rw-r--r--test/Doctest.hs13
-rw-r--r--verifuzz.cabal19
3 files changed, 34 insertions, 4 deletions
diff --git a/Setup.hs b/Setup.hs
index 4467109..f7c5518 100644
--- a/Setup.hs
+++ b/Setup.hs
@@ -1,2 +1,4 @@
-import Distribution.Simple
-main = defaultMain
+import Distribution.Extra.Doctest
+
+main :: IO ()
+main = defaultMainWithDoctests "verifuzz-doctest"
diff --git a/test/Doctest.hs b/test/Doctest.hs
index 736ea72..421f3d6 100644
--- a/test/Doctest.hs
+++ b/test/Doctest.hs
@@ -1 +1,12 @@
-{-# options_ghc -F -pgmF doctest-discover -optF test/doctest.json #-}
+module Main where
+
+import Build_doctests (flags, module_sources, pkgs)
+import Data.Foldable (traverse_)
+import Test.DocTest (doctest)
+
+main :: IO ()
+main = do
+ traverse_ putStrLn args -- optionally print arguments
+ doctest args
+ where
+ args = flags ++ pkgs ++ module_sources
diff --git a/verifuzz.cabal b/verifuzz.cabal
index 5e92c68..598b92a 100644
--- a/verifuzz.cabal
+++ b/verifuzz.cabal
@@ -11,11 +11,17 @@ author: Yann Herklotz
maintainer: yann [at] ymhg [dot] org
copyright: 2018 Yann Herklotz
category: Web
-build-type: Simple
+build-type: Custom
cabal-version: >=1.10
extra-source-files: README.md
, data/*.v
+custom-setup
+ setup-depends:
+ base >= 4 && <5,
+ cabal-doctest >= 1 && <1.1,
+ Cabal >= 1.10 && <2.5
+
library
hs-source-dirs: src
default-language: Haskell2010
@@ -106,3 +112,14 @@ test-suite verifuzz-test
, text >=1.2 && <1.3
, parsec >= 3.1 && < 3.2
default-extensions: OverloadedStrings
+
+test-suite verifuzz-doctest
+ default-language: Haskell2010
+ type: exitcode-stdio-1.0
+ hs-source-dirs: test
+ main-is: Doctest.hs
+ ghc-options: -Wall -Werror
+ build-depends: base >=4.7 && <5
+ , doctest >=0.16 && <0.17
+ , verifuzz
+ default-extensions: OverloadedStrings