Chris@40: #!/bin/bash Chris@40: Chris@40: Chris@40: # Check where we're being run from. Chris@40: if test -d Octave ; then Chris@40: cd Octave Chris@40: octave_src_dir=$(pwd) Chris@40: elif test -z "$octave_src_dir" ; then Chris@40: echo Chris@40: echo "Error : \$octave_src_dir is undefined." Chris@40: echo Chris@40: exit 1 Chris@40: else Chris@40: octave_src_dir=$(cd $octave_src_dir && pwd) Chris@40: fi Chris@40: Chris@40: # Find libsndfile shared object. Chris@40: libsndfile_lib_location="" Chris@40: Chris@40: if test -f "../src/.libs/libsndfile.so" ; then Chris@40: libsndfile_lib_location="../src/.libs/" Chris@40: elif test -f "../src/libsndfile.so" ; then Chris@40: libsndfile_lib_location="../src/" Chris@40: elif test -f "../src/.libs/libsndfile.dylib" ; then Chris@40: libsndfile_lib_location="../src/.libs/" Chris@40: elif test -f "../src/libsndfile.dylib" ; then Chris@40: libsndfile_lib_location="../src/" Chris@40: else Chris@40: echo Chris@40: echo "Not able to find the libsndfile shared lib we've just built." Chris@40: echo "This may cause the following test to fail." Chris@40: echo Chris@40: fi Chris@40: Chris@40: libsndfile_lib_location=`(cd $libsndfile_lib_location && pwd)` Chris@40: Chris@40: Chris@40: # Find sndfile.oct Chris@40: sndfile_oct_location="" Chris@40: Chris@40: if test -f .libs/sndfile.oct ; then Chris@40: sndfile_oct_location=".libs" Chris@40: elif test -f sndfile.oct ; then Chris@40: sndfile_oct_location="." Chris@40: else Chris@40: echo "Not able to find the sndfile.oct binaries we've just built." Chris@40: exit 1 Chris@40: fi Chris@40: Chris@40: case `file -b $sndfile_oct_location/sndfile.oct` in Chris@40: ELF*) Chris@40: ;; Chris@40: Mach*) Chris@40: echo "Tests don't work on this platform." Chris@40: exit 0 Chris@40: ;; Chris@40: *) Chris@40: echo "Not able to find the sndfile.oct binary we just built." Chris@40: exit 1 Chris@40: ;; Chris@40: esac Chris@40: Chris@40: Chris@40: # Make sure the TERM environment variable doesn't contain anything wrong. Chris@40: unset TERM Chris@40: # echo "octave_src_dir : $octave_src_dir" Chris@40: # echo "libsndfile_lib_location : $libsndfile_lib_location" Chris@40: # echo "sndfile_oct_location : $sndfile_oct_location" Chris@40: Chris@40: if test ! -f PKG_ADD ; then Chris@40: cp $octave_src_dir/PKG_ADD . Chris@40: fi Chris@40: Chris@40: export LD_LIBRARY_PATH="$libsndfile_lib_location:$LD_LIBRARY_PATH" Chris@40: Chris@40: octave_script="$octave_src_dir/octave_test.m" Chris@40: Chris@40: (cd $sndfile_oct_location && octave -qH $octave_script) Chris@40: res=$? Chris@40: echo Chris@40: exit $res