minor syntax
[flac.git] / test / test_libFLAC.sh
index 44ddf4d..75d77e1 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #  FLAC - Free Lossless Audio Codec
-#  Copyright (C) 2001,2002  Josh Coalson
+#  Copyright (C) 2001,2002,2003  Josh Coalson
 #
 #  This program is part of FLAC; you can redistribute it and/or
 #  modify it under the terms of the GNU General Public License
 #  along with this program; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
-LD_LIBRARY_PATH=../src/libFLAC/.libs:../obj/lib:$LD_LIBRARY_PATH
+die ()
+{
+       echo $* 1>&2
+       exit 1
+}
+
+LD_LIBRARY_PATH=../src/libFLAC/.libs:../obj/release/lib:../obj/debug/lib:$LD_LIBRARY_PATH
 export LD_LIBRARY_PATH
-PATH=../src/test_libFLAC:../obj/bin:$PATH
+PATH=../src/test_libFLAC:../obj/release/bin:../obj/debug/bin:$PATH
 export PATH
 
-if test_libFLAC ; then : ; else
-       echo "ERROR during test_libFLAC" 1>&2
-       exit 1
-fi
+run_test_libFLAC ()
+{
+       if [ x"$FLAC__VALGRIND" = xyes ] ; then
+               valgrind --leak-check=yes --show-reachable=yes --num-callers=100 --logfile-fd=4 test_libFLAC $* 4>>test_libFLAC.valgrind.log
+       else
+               test_libFLAC $*
+       fi
+}
+
+run_test_libFLAC || die "ERROR during test_libFLAC"