3 # FLAC - Free Lossless Audio Codec
4 # Copyright (C) 2001,2002,2003,2004 Josh Coalson
6 # This file is part the FLAC project. FLAC is comprised of several
7 # components distributed under difference licenses. The codec libraries
8 # are distributed under Xiph.Org's BSD-like license (see the file
9 # COPYING.Xiph in this distribution). All other programs, libraries, and
10 # plugins are distributed under the GPL (see COPYING.GPL). The documentation
11 # is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
12 # FLAC distribution contains at the top the terms under which it may be
15 # Since this particular file is relevant to all components of FLAC,
16 # it may be distributed under the Xiph.Org license, which is the least
17 # restrictive of those mentioned above. See the file COPYING.Xiph in this
26 LD_LIBRARY_PATH=../src/libFLAC/.libs:../src/share/grabbag/.libs:../obj/release/lib:../obj/debug/lib:$LD_LIBRARY_PATH
27 export LD_LIBRARY_PATH
28 PATH=../src/test_grabbag/cuesheet:../obj/release/bin:../obj/debug/bin:$PATH
30 test_cuesheet -h 1>/dev/null 2>/dev/null || die "ERROR can't find test_cuesheet executable"
34 if [ x"$FLAC__VALGRIND" = xyes ] ; then
35 valgrind --leak-check=yes --show-reachable=yes --num-callers=100 --logfile-fd=4 test_cuesheet $* 4>>test_grabbag.valgrind.log
41 ########################################################################
45 ########################################################################
48 bad_cuesheets=cuesheets/bad.*.cue
49 good_cuesheets=cuesheets/good.*.cue
50 good_leadout=`expr 80 \* 60 \* 44100`
51 bad_leadout=`expr $good_leadout + 1`
58 for cuesheet in $bad_cuesheets ; do
59 echo "NEGATIVE $cuesheet" >> $log 2>&1
60 run_test_cuesheet $cuesheet $good_leadout cdda >> $log 2>&1
62 if [ "$exit_code" = 255 ] ; then
63 die "Error: test script is broken"
65 cuesheet_pass1=${cuesheet}.1
66 cuesheet_pass2=${cuesheet}.2
67 rm -f $cuesheet_pass1 $cuesheet_pass2
73 for cuesheet in $good_cuesheets ; do
74 echo "POSITIVE $cuesheet" >> $log 2>&1
75 run_test_cuesheet $cuesheet $good_leadout cdda >> $log 2>&1
77 if [ "$exit_code" = 255 ] ; then
78 die "Error: test script is broken"
79 elif [ "$exit_code" != 0 ] ; then
80 die "Error: good cuesheet is broken"
82 cuesheet_pass1=${cuesheet}.1
83 cuesheet_pass2=${cuesheet}.2
84 diff $cuesheet_pass1 $cuesheet_pass2 >> $log 2>&1 || die "Error: pass1 and pass2 output differ"
85 rm -f $cuesheet_pass1 $cuesheet_pass2
88 diff cuesheet.ok $log > cuesheet.diff || die "Error: .log file does not match .ok file, see cuesheet.diff"
90 echo "PASSED (results are in $log)"