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
|
|
|
|
|
2015-06-05 15:08:52 +02:00
|
|
|
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
|
|
|
. "$DIR"/lib/common.sh
|
|
|
|
|
2015-09-23 15:48:41 +02:00
|
|
|
# TODO: Remove missing-methods after https://github.com/bos/aeson/issues/290
|
|
|
|
GHC_FLAGS="-Werror -fno-warn-missing-methods"
|
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
|
2015-05-14 04:35:35 +02:00
|
|
|
(cd "$s" && $CABAL sandbox init --sandbox=../.cabal-sandbox/ && $CABAL sandbox add-source .)
|
2015-04-20 11:57:55 +02:00
|
|
|
done
|
2015-05-14 04:35:35 +02:00
|
|
|
$CABAL install --enable-tests ${SOURCES[@]}
|
2015-04-20 11:57:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
test_each () {
|
|
|
|
for s in ${SOURCES[@]} ; do
|
|
|
|
echo "Testing $s..."
|
2015-05-14 04:35:35 +02:00
|
|
|
pushd "$s"
|
2015-04-20 19:52:29 +02:00
|
|
|
$CABAL configure --enable-tests --ghc-options="$GHC_FLAGS"
|
|
|
|
$CABAL build
|
|
|
|
$CABAL test
|
2015-05-14 04:35:35 +02:00
|
|
|
popd
|
2015-04-20 11:57:55 +02:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
prepare_sandbox
|
|
|
|
test_each
|