initial import
authorJosh Coalson <jcoalson@users.sourceforce.net>
Fri, 14 Jun 2002 06:31:35 +0000 (06:31 +0000)
committerJosh Coalson <jcoalson@users.sourceforce.net>
Fri, 14 Jun 2002 06:31:35 +0000 (06:31 +0000)
test/test_metaflac.sh [new file with mode: 0755]

diff --git a/test/test_metaflac.sh b/test/test_metaflac.sh
new file mode 100755 (executable)
index 0000000..639a646
--- /dev/null
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+#  FLAC - Free Lossless Audio Codec
+#  Copyright (C) 2002  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
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy 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
+export LD_LIBRARY_PATH
+PATH=../src/flac:../src/metaflac:../obj/bin:$PATH
+
+flacfile=metaflac.flac
+
+flac --help 1>/dev/null 2>/dev/null || echo "ERROR can't find flac executable" 1>&2 && exit 1
+metaflac --help 1>/dev/null 2>/dev/null || echo "ERROR can't find metaflac executable" 1>&2 && exit 1
+
+echo "Generating streams..."
+if flac -V -0 -o $flacfile -fr -fb -fc 1 -fp 8 -fs 44100 `which metaflac` ; then : ; else
+       echo "ERROR during generation" 1>&2
+       exit 1
+fi
+
+check_exit ()
+{
+       exit_code=$?
+       if [ $exit_code != 0 ] ; then
+               echo "ERROR, exit code = $exit_code" 1>&2
+               exit 1
+       fi
+}
+
+check_flac ()
+{
+       if flac -t $flacfile ; then : ; else
+               echo "ERROR if $flacfile" 1>&2
+               exit 1
+       fi
+}
+
+check_flac
+metaflac --list $flacfile