Skip to content

Commit

Permalink
Resolve #19 by adding a caveat to the README
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanGlScott committed Jul 27, 2017
1 parent babff18 commit 284cf5a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,18 @@ test-suite doctests:
Notes
-----

* `Cabal-2.0` can be finicky about whether it builds the library component or
the `doctests` test suite component first. However, in order for
`cabal-doctest` to work correctly, the library _must_ be built first, as
`doctest` relies on the presence of generated files that are only created
when the library is built. See
[#19](https://github.com/phadej/cabal-doctest/issues/19).

To avoid headaches, it is recommended that you depend on the library itself
in the `doctests` test suite. See
[the example's .cabal file](https://github.com/phadej/cabal-doctest/blob/master/example/example.cabal)
for a demonstration.

* `custom-setup` section is supported starting from `cabal-install-1.24`.
For older `cabal-install's` you have to install custom setup dependencies
manually.
Expand All @@ -94,11 +106,6 @@ Notes
about adding `cabal doctest` command. After that command is implemented,
this library will be deprecated.

* If your library contains `cbits`, you might need to depend on the library
itself in `doctests` test-suite. We aren't sure whether this a bug or not.
See [#5 issue](https://github.com/phadej/cabal-doctest/issues/5) for longer
explanation.

* You can use `x-doctest-options` field in `test-suite doctests` to
pass additional flags to the `doctest`.

Expand Down
3 changes: 2 additions & 1 deletion example/example.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ test-suite doctests
main-is: doctests.hs
build-depends:
base,
doctest >= 0.11.3 && <0.12,
doctest >= 0.11.3 && <0.13,
example,
QuickCheck ==2.10.*,
template-haskell
ghc-options: -Wall -threaded
Expand Down

0 comments on commit 284cf5a

Please sign in to comment.