2016-05-03 21:17:06 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
function testcmd()
|
|
|
|
{
|
2016-12-04 23:31:03 +03:00
|
|
|
local pkg=$1
|
2016-05-03 21:17:06 +03:00
|
|
|
shift
|
2016-12-04 23:31:03 +03:00
|
|
|
local stackopts=$*
|
2016-05-03 21:17:06 +03:00
|
|
|
|
2016-12-04 23:31:03 +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
|
|
|
|
|
2016-12-04 23:31:03 +03:00
|
|
|
# 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
|
|
|
|
2016-12-04 23:31:03 +03:00
|
|
|
# Test everything else.
|
2016-05-03 21:17:06 +03:00
|
|
|
for pkg in hunit-dejafu tasty-dejafu async-dejafu; do
|
2016-12-04 23:31:03 +03:00
|
|
|
testcmd $pkg $STACKOPTS
|
2016-05-03 21:17:06 +03:00
|
|
|
done
|