Closed andreabedini closed 4 months ago
Could you change this so that the doctests will be run when you do
cabal test
?
Unfortunately the short answer is no. This is exactly how doctest
recommends to be run https://github.com/sol/doctest#running-doctest-for-a-cabal-package.
cabal has a new feature that would allow running doctest with cabal test
but that would require coordination with doctest I am afraid. So I thought I'd stick with the recommended way.
@andreabedini My two requirements here would be:
cabal test
would also run the doctests.cabal-doctest
in the past, so maybe don't need to include this one)cabal-doctest
currently meets these requirements, but has the following drawbacks:
Custom
It would be great if there was a doctest solution that meets all of my above requirements, and doesn't have any of these drawbacks.
The new SetupHooks API will provide a better solution.
cabal-doctest is no longer unsupported or needed.
The author of the
doctest
package recommends^1 to run doctests withcabal repl --with-ghc=doctest
This change removes the custom-setup and adjusts the test-suite to use the recommended approach above. The package
doctest
is added to the project withextra-packages
to make sure its dependencies are always in scope (a small variation to the approach suggested by thedoctest
author).