From 7351c072bd60f98de69677e0d78b4fa9bb69904b Mon Sep 17 00:00:00 2001 From: "Julian K. Arni" Date: Mon, 20 Apr 2015 11:57:55 +0200 Subject: [PATCH] Update travis.yml for merged repos --- .travis.yml | 19 +------------------ scripts/test-all.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 18 deletions(-) create mode 100755 scripts/test-all.sh 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