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