diff --git a/localize.sh b/localize.sh index 4b69c2f6b..3d034f508 100755 --- a/localize.sh +++ b/localize.sh @@ -1,10 +1,12 @@ #!/bin/bash + # TODO - use rpath to avoid needing this to run tests locally + export CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -if [ $(uname -s) = 'Darwin' ]; then - export DYLD_LIBRARY_PATH="${CURRENT_DIR}/src/":${DYLD_LIBRARY_PATH} -else - export LD_LIBRARY_PATH="${CURRENT_DIR}/src/":${LD_LIBRARY_PATH} +if [[ $(uname -s) == 'Darwin' ]]; then + export DYLD_LIBRARY_PATH="${CURRENT_DIR}/src/":${DYLD_LIBRARY_PATH:-""} +elif [[ $(uname -s) == 'Linux' ]]; then + export LD_LIBRARY_PATH="${CURRENT_DIR}/src/":${LD_LIBRARY_PATH:-""} fi export PATH=$(pwd)/utils/mapnik-render/:${PATH} diff --git a/test/run b/test/run index f623609eb..54c4d6fb4 100755 --- a/test/run +++ b/test/run @@ -1,5 +1,8 @@ #!/usr/bin/env bash +set -o pipefail +set -eu + failures=0 cd "$( dirname "${BASH_SOURCE[0]}" )" @@ -18,9 +21,8 @@ if [ -d "test/data" ]; then run_substep "Running C++ Unit tests..." if [[ -f ./test/unit/run ]]; then - ./test/unit/run - failures=$((failures+$?)) ran_a_test=true + ./test/unit/run || failures=$((failures+$?)) else run_warn "Skipping unit tests since they were not built" fi @@ -31,8 +33,7 @@ if [ -d "test/data" ]; then for FILE in test/standalone/*-bin; do found_test=true ran_a_test=true - ${FILE}; - failures=$((failures+$?)) + ${FILE} || failures=$((failures+$?)) done fi if [[ $found_test == false ]]; then @@ -45,9 +46,8 @@ if [ -d "test/data" ]; then JOBS=1 fi if [[ -f ./test/visual/run ]]; then - ./test/visual/run -j $JOBS ran_a_test=true - failures=$((failures+$?)) + ./test/visual/run -j $JOBS || failures=$((failures+$?)) else run_warn "Skipping visual tests since they were not built" fi