dejafu/test-build.sh

45 lines
850 B
Bash
Raw Normal View History

2016-05-03 21:17:06 +03:00
#!/usr/bin/env bash
function testcmd()
{
local pkg=$1
2016-05-03 21:17:06 +03:00
shift
local stackopts=$*
2016-05-03 21:17:06 +03:00
echo "== ${pkg}"
if stack $stackopts test $pkg; then
2016-05-03 21:17:06 +03:00
echo
else
echo "== FAILED"
exit 1
fi
}
# Set the resolver. Uses the environment variable "RESOLVER" if set,
# otherwise whatever is in the "stack.yaml" file.
STACKOPTS="--no-terminal --install-ghc --resolver=$RESOLVER"
if [[ "$RESOLVER" == "" ]]; then
STACKOPTS="--no-terminal --install-ghc"
fi
2016-10-22 18:02:31 +03:00
stack $STACKOPTS setup
# Make sure 'concurrency' builds.
testcmd concurrency $STACKOPTS
# Test 'dejafu'.
echo "== dejafu"
if ! stack $STACKOPTS build dejafu-tests; then
echo "== FAILED (build)"
exit 1
fi
if ! stack $STACKOPTS exec dejafu-tests; then
echo "== FAILED (test)"
exit 1
fi
2016-05-03 21:17:06 +03:00
# Test everything else.
2017-03-04 01:19:42 +03:00
for pkg in hunit-dejafu tasty-dejafu; do
testcmd $pkg $STACKOPTS
2016-05-03 21:17:06 +03:00
done