2016-05-03 21:17:06 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
function testcmd()
|
|
|
|
{
|
|
|
|
local name=$1
|
|
|
|
shift
|
|
|
|
local command=$*
|
|
|
|
|
|
|
|
echo "== ${name}"
|
|
|
|
if $command; then
|
|
|
|
echo
|
|
|
|
else
|
|
|
|
echo "== FAILED"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2016-06-06 00:03:30 +03:00
|
|
|
function testdejafu()
|
|
|
|
{
|
|
|
|
local name=$1
|
|
|
|
shift
|
|
|
|
local stackopts=$*
|
|
|
|
|
|
|
|
echo "== $name"
|
|
|
|
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
|
|
|
# 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
|
|
|
|
|
2016-06-06 00:03:30 +03:00
|
|
|
testdejafu "dejafu" $STACKOPTS
|
2016-05-03 21:17:06 +03:00
|
|
|
|
|
|
|
for pkg in hunit-dejafu tasty-dejafu async-dejafu; do
|
|
|
|
testcmd "${pkg}" stack $STACKOPTS test $pkg
|
|
|
|
done
|