Hi Henning:

I’m quite interested in this, especially as doctest on GHC 8.10 has issues: https://github.com/sol/doctest/issues/264 Furthermore, compiling doctests would be a huge performance boost and can speed up CI times significantly.

I’m curious why your new package does not support IO-tests. Is that a “current” limitation, or is there a fundamental reason why IO-tests ca not be supported using your approach.

Cheers,

-Levent.

On Aug 1, 2020, at 3:15 AM, Henning Thielemann <lemming@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.