diff --git a/.travis.yml b/.travis.yml index 6712498d..d7a24fd1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,25 +3,8 @@ language: haskell ghc: - 7.8 -before_install: - - cabal update - - cabal sandbox init - -install: - - cabal install --only-dependencies --enable-tests - script: - - cabal configure --enable-tests --enable-library-coverage && cabal build && cabal test - - cabal check - - cabal sdist - -after_script: - - | - if [ "$TRAVIS_PULL_REQUEST" -eq "$TRAVIS_PULL_REQUEST" ] 2>/dev/null || [ "$TRAVIS_BRANCH" == "master" ] ; then - cabal install hpc-coveralls - hpc-coveralls --exclude-dir=test spec doctests - fi - + - ./scripts/test-all.sh notifications: irc: diff --git a/scripts/test-all.sh b/scripts/test-all.sh new file mode 100755 index 00000000..990d3a1c --- /dev/null +++ b/scripts/test-all.sh @@ -0,0 +1,42 @@ +#!/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. +# +#=============================================================================== + +set -o nounset +set -o errexit + +SOURCES=( servant servant-server servant-client servant-jquery servant-docs ) +GHC_FLAGS="-Werror" + +prepare_sandbox () { + cabal sandbox init + for s in ${SOURCES[@]} ; do + cd "$s" + cabal sandbox init --sandbox=../ + cabal sandbox add-source . + cd .. + done +} + +test_each () { + for s in ${SOURCES[@]} ; do + echo "Testing $s..." + cd "$s" + cabal install --only-dependencies --enable-tests + cabal configure --enable-tests --ghc-options="$GHC_FLAGS" + cabal build + cabal test + cd .. + done +} + +prepare_sandbox +test_each