Generate driver file for doctest's cabal integration

Version on this page:
LTS Haskell 22.18:
Stackage Nightly 2024-04-20:
Latest on Hackage:

See all snapshots doctest-driver-gen appears in

BSD-3-Clause licensed by Hexirp
Maintained by
This version can be pinned in stack with:doctest-driver-gen-,1986

Module documentation for

Used by 1 package in lts-16.31(full list with versions):


Hackage version Build Status Stackage LTS Stackage Nightly

doctest-driver-gen is a doctest’s driver file generator. It lets you automatically generate driver file for doctest’s cabal integration.

Versions of doctest available in this library: >= 0.7 && < 0.12 || >= 0.13 && < 0.17


{-# OPTIONS_GHC -F -pgmF doctest-driver-gen [-optF DOCTEST_OPTION]... #-}

Make your driver file with the content. There is an example:

{-# OPTIONS_GHC -F -pgmF doctest-driver-gen -optF src -optF app #-}


This package was motivated by doctest-discover. I want a simpler doctest’s driver file generator.


Changelog for doctest-driver-gen

  • Update build-depends to allow base-

  • Add build-tool-depends to make stack test work normally (contribution by qrilka).

  • Update the template file (in ddgen_output) to consider to NoImplicitPrelude.
  • Fix the build fail when GHC’s version is less than 8.0.x.

  • Update build-depends to allow base-

  • Update build-depends to allow doctest-

  • Update build-depends to allow doctest-

  • Update build-depends to allow base-

  • Add ddgen_run.
  • Update ddgen_output to reduce arguments for simplicity.
  • Update build-depends to allow doctest-0.14.

  • Update build-depends to be strict. (Initial)

  • Add a executable program: doctest-driver-gen.
  • Add Test.DocTest.Gen, ddgen, ddgen_output, and ddgen_usage.