servant/scripts/test-all.sh

40 lines
941 B
Bash
Raw Normal View History

2015-04-20 11:57:55 +02:00
#!/bin/bash -
#===============================================================================
#
# FILE: test-all.sh
#
# USAGE: ./test-all.sh
#
# DESCRIPTION: Run tests for all source directories listed in $SOURCES.
# Uses local versions of those sources.
#
2015-04-20 19:13:06 +02:00
# REQUIREMENTS: bash >= 4
2015-04-20 11:57:55 +02:00
#===============================================================================
set -o nounset
set -o errexit
. lib/common.sh
2015-04-20 11:57:55 +02:00
prepare_sandbox () {
2015-04-20 19:52:29 +02:00
$CABAL sandbox init
2015-04-20 11:57:55 +02:00
for s in ${SOURCES[@]} ; do
(cd "$s" && $CABAL sandbox init --sandbox=../.cabal-sandbox/ && $CABAL sandbox add-source .)
2015-04-20 11:57:55 +02:00
done
$CABAL install --enable-tests ${SOURCES[@]}
2015-04-20 11:57:55 +02:00
}
test_each () {
for s in ${SOURCES[@]} ; do
echo "Testing $s..."
pushd "$s"
2015-04-20 19:52:29 +02:00
$CABAL configure --enable-tests --ghc-options="$GHC_FLAGS"
$CABAL build
$CABAL test
popd
2015-04-20 11:57:55 +02:00
done
}
prepare_sandbox
test_each