blob: 319d86b81e22f8fd30099338cf9304402f73d673 [file] [log] [blame]
Alexandre Lision7c6f4a62013-09-05 13:27:01 -04001#!/bin/bash
2
3
4# Check where we're being run from.
5if [ -d Octave ]; then
6 cd Octave
7 fi
8
9# Find libsndfile shared object.
10libsndfile_lib_location=""
11
12if [ -f "../src/.libs/libsndfile.so" ]; then
13 libsndfile_lib_location="../src/.libs/"
14elif [ -f "../src/libsndfile.so" ]; then
15 libsndfile_lib_location="../src/"
16elif [ -f "../src/.libs/libsndfile.dylib" ]; then
17 libsndfile_lib_location="../src/.libs/"
18elif [ -f "../src/libsndfile.dylib" ]; then
19 libsndfile_lib_location="../src/"
20else
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
27libsndfile_lib_location=`(cd $libsndfile_lib_location && pwd)`
28
29
30# Find sndfile.oct
31sndfile_oct_location=""
32
33if [ -f .libs/sndfile.oct ]; then
34 sndfile_oct_location=".libs"
35elif [ -f sndfile.oct ]; then
36 sndfile_oct_location="."
37else
38 echo "Not able to find the sndfile.oct binaries we've just built."
39 exit 1
40 fi
41
42case `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.
57unset TERM
58
59# echo "libsndfile_lib_location : $libsndfile_lib_location"
60# echo "sndfile_oct_location : $sndfile_oct_location"
61
62export LD_LIBRARY_PATH="$libsndfile_lib_location:$LD_LIBRARY_PATH"
63
64octave_src_dir=`(cd $octave_src_dir && pwd)`
65
66octave_script="$octave_src_dir/octave_test.m"
67
68(cd $sndfile_oct_location && octave -qH $octave_script)
69
70