3 # FLAC - Free Lossless Audio Codec
4 # Copyright (C) 2001-2009 Josh Coalson
5 # Copyright (C) 2011-2013 Xiph.Org Foundation
7 # This file is part the FLAC project. FLAC is comprised of several
8 # components distributed under different licenses. The codec libraries
9 # are distributed under Xiph.Org's BSD-like license (see the file
10 # COPYING.Xiph in this distribution). All other programs, libraries, and
11 # plugins are distributed under the GPL (see COPYING.GPL). The documentation
12 # is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
13 # FLAC distribution contains at the top the terms under which it may be
16 # Since this particular file is relevant to all components of FLAC,
17 # it may be distributed under the Xiph.Org license, which is the least
18 # restrictive of those mentioned above. See the file COPYING.Xiph in this
27 if [ x = x"$1" ] ; then
33 LD_LIBRARY_PATH=../src/libFLAC/.libs:$LD_LIBRARY_PATH
34 LD_LIBRARY_PATH=../src/share/grabbag/.libs:$LD_LIBRARY_PATH
35 LD_LIBRARY_PATH=../src/share/replaygain_analysis/.libs:$LD_LIBRARY_PATH
36 LD_LIBRARY_PATH=../objs/$BUILD/lib:$LD_LIBRARY_PATH
37 export LD_LIBRARY_PATH
38 export MALLOC_CHECK_=3
39 export MALLOC_PERTURB_=$(($(date +%s) % 255 + 1))
40 PATH=../src/test_grabbag/cuesheet:$PATH
41 PATH=../src/test_grabbag/picture:$PATH
42 PATH=../objs/$BUILD/bin:$PATH
44 test_cuesheet -h 1>/dev/null 2>/dev/null || die "ERROR can't find test_cuesheet executable"
45 test_picture -h 1>/dev/null 2>/dev/null || die "ERROR can't find test_picture executable"
49 if [ x"$FLAC__TEST_WITH_VALGRIND" = xyes ] ; then
50 echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=50 test_cuesheet $*" >>test_grabbag.valgrind.log
51 valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 test_cuesheet $* 4>>test_grabbag.valgrind.log
59 if [ x"$FLAC__TEST_WITH_VALGRIND" = xyes ] ; then
60 echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=50 test_picture $*" >>test_grabbag.valgrind.log
61 valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 test_picture $* 4>>test_grabbag.valgrind.log
67 if [ `env | grep -ic '^comspec='` != 0 ] ; then
73 ########################################################################
77 ########################################################################
82 echo "Running test_picture..."
86 run_test_picture $picture_dir >> $log 2>&1
88 if [ $is_win = yes ] ; then
89 diff -w picture.ok $log > picture.diff || die "Error: .log file does not match .ok file, see picture.diff"
91 diff picture.ok $log > picture.diff || die "Error: .log file does not match .ok file, see picture.diff"
94 echo "PASSED (results are in $log)"
96 ########################################################################
100 ########################################################################
103 bad_cuesheets=cuesheets/bad.*.cue
104 good_cuesheets=cuesheets/good.*.cue
105 good_leadout=`expr 80 \* 60 \* 44100`
106 bad_leadout=`expr $good_leadout + 1`
108 echo "Running test_cuesheet..."
115 for cuesheet in $bad_cuesheets ; do
116 echo "NEGATIVE $cuesheet" >> $log 2>&1
117 run_test_cuesheet $cuesheet $good_leadout 44100 cdda >> $log 2>&1
119 if [ "$exit_code" = 255 ] ; then
120 die "Error: test script is broken"
122 cuesheet_pass1=${cuesheet}.1
123 cuesheet_pass2=${cuesheet}.2
124 rm -f $cuesheet_pass1 $cuesheet_pass2
130 for cuesheet in $good_cuesheets ; do
131 echo "POSITIVE $cuesheet" >> $log 2>&1
132 run_test_cuesheet $cuesheet $good_leadout 44100 cdda >> $log 2>&1
134 if [ "$exit_code" = 255 ] ; then
135 die "Error: test script is broken"
136 elif [ "$exit_code" != 0 ] ; then
137 die "Error: good cuesheet is broken"
139 cuesheet_pass1=${cuesheet}.1
140 cuesheet_pass2=${cuesheet}.2
141 diff $cuesheet_pass1 $cuesheet_pass2 >> $log 2>&1 || die "Error: pass1 and pass2 output differ"
142 rm -f $cuesheet_pass1 $cuesheet_pass2
145 if [ $is_win = yes ] ; then
146 diff -w cuesheet.ok $log > cuesheet.diff || die "Error: .log file does not match .ok file, see cuesheet.diff"
148 diff cuesheet.ok $log > cuesheet.diff || die "Error: .log file does not match .ok file, see cuesheet.diff"
151 echo "PASSED (results are in $log)"