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