diff --git a/test/Makefile b/test/Makefile index 0f501f1a..e54399a8 100644 --- a/test/Makefile +++ b/test/Makefile @@ -47,7 +47,7 @@ all: test top_srcdir = .. # Initialisations -SHELL = /bin/sh +SHELL = /bin/bash .SUFFIXES: @@ -137,15 +137,7 @@ unit_test : -@./$@.sh tests: - -@if [ -e $$EXIV2_BINDIR/../Makefile ]; then \ - -@./$@.sh ; \ - else \ - make unit_test ; \ - make bash_tests ; \ - make python_tests ; \ - make version_test ; \ - fi - + make unit_test bash_tests python_tests version_test bash_tests: @echo @@ -167,7 +159,7 @@ python_tests: @echo @echo ---- Running python_tests ---- @echo - -( cd ../tests ; if [ ! -z $$VERBOSE ]; then verbose=--verbose ;fi ; python3 runner.py $$verbose ) + -( source functions.source ; cd ../tests ; if [ ! -z $$VERBOSE ]; then verbose=--verbose ;fi ; python3 runner.py $$verbose ) testv: @for t in /video ; do \ diff --git a/test/functions.source b/test/functions.source index 9f98de39..04974ce3 100644 --- a/test/functions.source +++ b/test/functions.source @@ -478,20 +478,6 @@ prepareTest() export LC_ALL=C export TZ=BST-1 - ## - # initialize globals - this=$(basename $0 .sh) - here=$PWD - datapath="../data" - testdir="$here/tmp" - datadir="../data" - - if [ -z "$EXIV2_BINDIR" ] ; then - bin="$here/../build/bin/" - else - bin="$EXIV2_BINDIR/" - fi - os=$(uname) if [ "${os:0:4}" == "CYGW" ]; then export PLATFORM=cygwin @@ -509,6 +495,29 @@ prepareTest() exe=$EXIV2_EXT fi + ## + # initialize globals + this=$(basename $0 .sh) + here=$PWD + datapath="../data" + testdir="$here/tmp" + datadir="../data" + + if [ -z "$EXIV2_BINDIR" ] ; then + bin="$here/../build/bin/" + else + bin="$EXIV2_BINDIR/" + fi + + # update PATHs to ensure we load the the correct dynamlic library + if [ $PLATFORM == 'mingw' -a $PLATFORM == 'cygwin' ]; then + export PATH="$bin:$PATH" + elif [ 'PLATFORM' == 'Darwin' ]; then + export DYLD_LIBRARY_PATH="$bin/../lib:$DYLD_LIBRARY_PATH" + else + export LD_LIBRARY_PATH="$bin/../lib:$LD_LIBRARY_PATH" + fi + if [ "$PLATFORM" == cygwin ]; then # We need a private version of diff for linux compatibility diff()