Move doctests to shell script

This fixes various problems with doctest:

* https://github.com/sol/doctest/issues/245
* https://github.com/composewell/streamly/issues/83

Also clean up travis.yml for cabal-3.
This commit is contained in:
2019-12-30 21:55:55 +01:00
parent 3529ec2a15
commit f5c541b9cc
5 changed files with 36 additions and 98 deletions

22
run-doctests.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/sh
set -e
if [ -n "${SKIP_DOCTESTS}" ] ; then
echo "Skipping doctests"
exit 0
fi
if ! command -v doctest >/dev/null ; then
tempdir="$(mktemp -d)"
(
cd "${tempdir}"
cabal install --installdir="${tempdir}" doctest
)
export PATH="${tempdir}:$PATH"
fi
set -x
cabal exec doctest -- -isrc -XOverloadedStrings System.Posix.FilePath
cabal exec doctest -- -isrc -XOverloadedStrings HPath