on 0.4 help sign in
servant/scripts/test-all.sh
43 lines 1.1 kB history raw
1#!/bin/bash -
2#===============================================================================
3#
4# FILE: test-all.sh
5#
6# USAGE: ./test-all.sh
7#
8# DESCRIPTION: Run tests for all source directories listed in $SOURCES.
9# Uses local versions of those sources.
11# REQUIREMENTS: bash >= 4
12#===============================================================================
14set -o nounset
15set -o errexit
17DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
18. "$DIR"/lib/common.sh
20# TODO: Remove missing-methods after https://github.com/bos/aeson/issues/290
21GHC_FLAGS="-Werror -fno-warn-missing-methods"
23prepare_sandbox () {
24 $CABAL sandbox init
25 for s in ${SOURCES[@]} ; do
26 (cd "$s" && $CABAL sandbox init --sandbox=../.cabal-sandbox/ && $CABAL sandbox add-source .)
27 done
28 $CABAL install --enable-tests ${SOURCES[@]}
31test_each () {
32 for s in ${SOURCES[@]} ; do
33 echo "Testing $s..."
34 pushd "$s"
35 $CABAL configure --enable-tests --ghc-options="$GHC_FLAGS"
36 $CABAL build
37 $CABAL test
38 popd
39 done
42prepare_sandbox
43test_each