Skip to content

Instantly share code, notes, and snippets.

@phadej
Created January 8, 2017 11:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phadej/fdd74f4b4b40dc0a758ca6192cd66e83 to your computer and use it in GitHub Desktop.
Save phadej/fdd74f4b4b40dc0a758ca6192cd66e83 to your computer and use it in GitHub Desktop.
#!/bin/sh
DOCTESTVER=0.11.0
ROOTDIR=$(pwd)
set -e
# Fetch source
if [ ! -d doctest-$DOCTESTVER ]; then
cabal get doctest-$DOCTESTVER
fi
# Compile doctest
cd doctest-$DOCTESTVER
cabal new-build -w $ROOTDIR/inplace/bin/ghc-stage2 doctest:exe:doctest
DOCTESTBIN=$(find $ROOTDIR/doctest-$DOCTESTVER/dist-newstyle -type f -name doctest)
# Run doctests
for hsfile in $(find $ROOTDIR/libraries/base -type f -name '*.hs'); do
if grep -q '$setup' $hsfile; then
echo $hsfile
$DOCTESTBIN $hsfile
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment