annotate src/libsndfile-1.0.27/Octave/octave_test.sh @ 40:1df64224f5ac

Current libsndfile source
author Chris Cannam
date Tue, 18 Oct 2016 13:22:47 +0100
parents
children
rev   line source
Chris@40 1 #!/bin/bash
Chris@40 2
Chris@40 3
Chris@40 4 # Check where we're being run from.
Chris@40 5 if test -d Octave ; then
Chris@40 6 cd Octave
Chris@40 7 octave_src_dir=$(pwd)
Chris@40 8 elif test -z "$octave_src_dir" ; then
Chris@40 9 echo
Chris@40 10 echo "Error : \$octave_src_dir is undefined."
Chris@40 11 echo
Chris@40 12 exit 1
Chris@40 13 else
Chris@40 14 octave_src_dir=$(cd $octave_src_dir && pwd)
Chris@40 15 fi
Chris@40 16
Chris@40 17 # Find libsndfile shared object.
Chris@40 18 libsndfile_lib_location=""
Chris@40 19
Chris@40 20 if test -f "../src/.libs/libsndfile.so" ; then
Chris@40 21 libsndfile_lib_location="../src/.libs/"
Chris@40 22 elif test -f "../src/libsndfile.so" ; then
Chris@40 23 libsndfile_lib_location="../src/"
Chris@40 24 elif test -f "../src/.libs/libsndfile.dylib" ; then
Chris@40 25 libsndfile_lib_location="../src/.libs/"
Chris@40 26 elif test -f "../src/libsndfile.dylib" ; then
Chris@40 27 libsndfile_lib_location="../src/"
Chris@40 28 else
Chris@40 29 echo
Chris@40 30 echo "Not able to find the libsndfile shared lib we've just built."
Chris@40 31 echo "This may cause the following test to fail."
Chris@40 32 echo
Chris@40 33 fi
Chris@40 34
Chris@40 35 libsndfile_lib_location=`(cd $libsndfile_lib_location && pwd)`
Chris@40 36
Chris@40 37
Chris@40 38 # Find sndfile.oct
Chris@40 39 sndfile_oct_location=""
Chris@40 40
Chris@40 41 if test -f .libs/sndfile.oct ; then
Chris@40 42 sndfile_oct_location=".libs"
Chris@40 43 elif test -f sndfile.oct ; then
Chris@40 44 sndfile_oct_location="."
Chris@40 45 else
Chris@40 46 echo "Not able to find the sndfile.oct binaries we've just built."
Chris@40 47 exit 1
Chris@40 48 fi
Chris@40 49
Chris@40 50 case `file -b $sndfile_oct_location/sndfile.oct` in
Chris@40 51 ELF*)
Chris@40 52 ;;
Chris@40 53 Mach*)
Chris@40 54 echo "Tests don't work on this platform."
Chris@40 55 exit 0
Chris@40 56 ;;
Chris@40 57 *)
Chris@40 58 echo "Not able to find the sndfile.oct binary we just built."
Chris@40 59 exit 1
Chris@40 60 ;;
Chris@40 61 esac
Chris@40 62
Chris@40 63
Chris@40 64 # Make sure the TERM environment variable doesn't contain anything wrong.
Chris@40 65 unset TERM
Chris@40 66 # echo "octave_src_dir : $octave_src_dir"
Chris@40 67 # echo "libsndfile_lib_location : $libsndfile_lib_location"
Chris@40 68 # echo "sndfile_oct_location : $sndfile_oct_location"
Chris@40 69
Chris@40 70 if test ! -f PKG_ADD ; then
Chris@40 71 cp $octave_src_dir/PKG_ADD .
Chris@40 72 fi
Chris@40 73
Chris@40 74 export LD_LIBRARY_PATH="$libsndfile_lib_location:$LD_LIBRARY_PATH"
Chris@40 75
Chris@40 76 octave_script="$octave_src_dir/octave_test.m"
Chris@40 77
Chris@40 78 (cd $sndfile_oct_location && octave -qH $octave_script)
Chris@40 79 res=$?
Chris@40 80 echo
Chris@40 81 exit $res