annotate src/libsndfile-1.0.25/Octave/octave_test.sh @ 85:545efbb81310

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