-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | A Setup.hs helper for doctests running
--   
--   Currently (beginning of 2017), there isn't <tt>cabal doctest</tt>
--   command. Yet, to properly work doctest needs plenty of configuration.
--   This library provides the common bits for writing custom Setup.hs See
--   <a>Cabal/2327</a> for the progress of <tt>cabal doctest</tt>, i.e.
--   whether this library is obsolete.
@package cabal-doctest
@version 1.0.2


-- | The provided <a>generateBuildModule</a> generates
--   <tt>Build_doctests</tt> module. That module exports enough
--   configuration, so your doctests could be simply
--   
--   <pre>
--   module Main where
--   
--   import Build_doctests (flags, pkgs, module_sources)
--   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
--   </pre>
--   
--   To use this library in the <tt>Setup.hs</tt>, you should specify a
--   <tt>custom-setup</tt> section in the cabal file, for example:
--   
--   <pre>
--   custom-setup
--    setup-depends:
--      base &gt;= 4 &amp;&amp; &lt;5,
--      cabal-doctest &gt;= 1 &amp;&amp; &lt;1.1
--   </pre>
--   
--   <i>Note:</i> you don't need to depend on <tt>Cabal</tt> if you use
--   only <a>defaultMainWithDoctests</a> in the <tt>Setup.hs</tt>.
module Distribution.Extra.Doctest

-- | A default main with doctests:
--   
--   <pre>
--   import Distribution.Extra.Doctest
--          (defaultMainWithDoctests)
--   
--   main :: IO ()
--   main = defaultMainWithDoctests "doctests"
--   </pre>
defaultMainWithDoctests :: String -> IO ()

-- | Like <a>defaultMainWithDoctests</a>, for 'build-type: Configure'
--   packages.
defaultMainAutoconfWithDoctests :: String -> IO ()

addDoctestsUserHook :: String -> UserHooks -> UserHooks

-- | <a>simpleUserHooks</a> with <a>generateBuildModule</a> prepended to
--   the <a>buildHook</a>.
doctestsUserHooks :: String -> UserHooks

-- | Generate a build module for the test suite.
--   
--   <pre>
--   import Distribution.Simple
--          (defaultMainWithHooks, UserHooks(..), simpleUserHooks)
--   import Distribution.Extra.Doctest
--          (generateBuildModule)
--   
--   main :: IO ()
--   main = defaultMainWithHooks simpleUserHooks
--       { buildHook = pkg lbi hooks flags -&gt; do
--           generateBuildModule "doctests" flags pkg lbi
--           buildHook simpleUserHooks pkg lbi hooks flags
--       }
--   </pre>
generateBuildModule :: String -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ()
