[Haskell-cafe] doctest-extract

David Feuer david.feuer at gmail.com
Mon Aug 3 17:26:46 UTC 2020


See

https://stackoverflow.com/questions/8976488/quickcheck-exit-status-on-failures-and-cabal-integration

The gist is that you have to get the results of the QuickCheck test(s) and
use them outside the QuickCheck context.

On Sat, Aug 1, 2020, 6:15 AM Henning Thielemann <
lemming at henning-thielemann.de> wrote:

>
> I have started an alternative implementation of 'doctest'. In contrast to
> the original one, doctest-extract extracts Haskell test-modules from
> doctest comments. This integrates better with Cabal and its package
> version resolution and the tests are compiled, not interpreted in GHCi.
> Disadvantage is that doctest-extract does not support all features of
> 'doctest', e.g. IO-tests.
>
> I uploaded a preview as package candidates to Hackage:
>
> $ cabal install $(for pkg in doctest-extract-0.0 doctest-lib-0.0
> utility-ht-0.0.16 non-empty-0.3.3; do echo
> https://hackage.haskell.org/package/$pkg/candidate/$pkg.tar.gz; done)
>
>
> Extract test modules like so:
>
> $ doctest-extract -i src/ -o test/ --executable-main=Test/Main.hs
> --import-tested $$(cat test-module.list)
>
>
> There is still a problem: A failing QuickCheck test does not abort the
> whole test-suite. 'cabal test' will report success even if one QuickCheck
> property test fails. I wonder what is the proposed way to make a failing
> property fail the test-suite? I could use (QC.whenFail exitFailure). Is
> this the intended way?
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20200803/578f419b/attachment.html>


More information about the Haskell-Cafe mailing list