1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
#!/bin/sh
set -e
CABAL=${CABAL:-cabal}
HC=${HC:-ghc}
# Install cpphs if it is not in path
command -v cpphs || ${CABAL} v2-install --ignore-project --with-compiler "$HC" cpphs
# Regenerate quickcheck-hugs
sh make-hugs
find quickcheck-hugs
die() {
echo "TEST FAILED"
exit 1
}
dotest() {
echo "$2" | hugs -98 -Pquickcheck-hugs: -p'> ' "$1" | tee hugs.output
grep "$3" hugs.output || die
}
# Simple tests
dotest Test.QuickCheck 'quickCheck $ \xs -> reverse (reverse xs) === (xs :: [Int])' "OK, passed 100 tests."
|