@@ -0,0 +1,42 @@
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.
10+#
11+#===============================================================================
12+
13+set -o nounset
14+set -o errexit
15+
16+SOURCES=( servant servant-server servant-client servant-jquery servant-docs )
17+GHC_FLAGS="-Werror"
18+
19+prepare_sandbox () {
20+ cabal sandbox init
21+ for s in ${SOURCES[@]} ; do
22+ cd "$s"
23+ cabal sandbox init --sandbox=../
24+ cabal sandbox add-source .
25+ cd ..
26+ done
27+}
28+
29+test_each () {
30+ for s in ${SOURCES[@]} ; do
31+ echo "Testing $s..."
32+ cd "$s"
33+ cabal install --only-dependencies --enable-tests
34+ cabal configure --enable-tests --ghc-options="$GHC_FLAGS"
35+ cabal build
36+ cabal test
37+ cd ..
38+ done
39+}
40+
41+prepare_sandbox
42+test_each