summaryrefslogtreecommitdiff
path: root/Octave/octave_test.sh
diff options
context:
space:
mode:
authorLorry <lorry@roadtrain.codethink.co.uk>2012-07-18 20:35:05 +0100
committerLorry <lorry@roadtrain.codethink.co.uk>2012-07-18 20:35:05 +0100
commitaceb1f30497619786f1827e4c65992b890a07410 (patch)
treece33ac9d0d076a8ec4f993e614cf71a4d5daa7e7 /Octave/octave_test.sh
downloadlibsndfile-aceb1f30497619786f1827e4c65992b890a07410.tar.gz
Tarball conversion
Diffstat (limited to 'Octave/octave_test.sh')
-rwxr-xr-xOctave/octave_test.sh70
1 files changed, 70 insertions, 0 deletions
diff --git a/Octave/octave_test.sh b/Octave/octave_test.sh
new file mode 100755
index 0000000..319d86b
--- /dev/null
+++ b/Octave/octave_test.sh
@@ -0,0 +1,70 @@
+#!/bin/bash
+
+
+# Check where we're being run from.
+if [ -d Octave ]; then
+ cd Octave
+ fi
+
+# Find libsndfile shared object.
+libsndfile_lib_location=""
+
+if [ -f "../src/.libs/libsndfile.so" ]; then
+ libsndfile_lib_location="../src/.libs/"
+elif [ -f "../src/libsndfile.so" ]; then
+ libsndfile_lib_location="../src/"
+elif [ -f "../src/.libs/libsndfile.dylib" ]; then
+ libsndfile_lib_location="../src/.libs/"
+elif [ -f "../src/libsndfile.dylib" ]; then
+ libsndfile_lib_location="../src/"
+else
+ echo
+ echo "Not able to find the libsndfile shared lib we've just built."
+ echo "This may cause the following test to fail."
+ echo
+ fi
+
+libsndfile_lib_location=`(cd $libsndfile_lib_location && pwd)`
+
+
+# Find sndfile.oct
+sndfile_oct_location=""
+
+if [ -f .libs/sndfile.oct ]; then
+ sndfile_oct_location=".libs"
+elif [ -f sndfile.oct ]; then
+ sndfile_oct_location="."
+else
+ echo "Not able to find the sndfile.oct binaries we've just built."
+ exit 1
+ fi
+
+case `file -b $sndfile_oct_location/sndfile.oct` in
+ ELF*)
+ ;;
+ Mach*)
+ echo "Tests don't work on this platform."
+ exit 0
+ ;;
+ *)
+ echo "Not able to find the sndfile.oct binaries we've just built."
+ exit 1
+ ;;
+ esac
+
+
+# Make sure the TERM environment variable doesn't contain anything wrong.
+unset TERM
+
+# echo "libsndfile_lib_location : $libsndfile_lib_location"
+# echo "sndfile_oct_location : $sndfile_oct_location"
+
+export LD_LIBRARY_PATH="$libsndfile_lib_location:$LD_LIBRARY_PATH"
+
+octave_src_dir=`(cd $octave_src_dir && pwd)`
+
+octave_script="$octave_src_dir/octave_test.m"
+
+(cd $sndfile_oct_location && octave -qH $octave_script)
+
+