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