3 # FLAC - Free Lossless Audio Codec
4 # Copyright (C) 2001-2009 Josh Coalson
5 # Copyright (C) 2011-2014 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
23 PATH
=..
/src
/test_grabbag
/cuesheet
:$PATH
24 PATH
=..
/src
/test_grabbag
/picture
:$PATH
25 PATH
=..
/objs
/$BUILD/bin
:$PATH
27 test_cuesheet
-h 1>/dev
/null
2>/dev
/null || die
"ERROR can't find test_cuesheet executable"
28 test_picture
-h 1>/dev
/null
2>/dev
/null || die
"ERROR can't find test_picture executable"
32 if [ x
"$FLAC__TEST_WITH_VALGRIND" = xyes
] ; then
33 echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=50 test_cuesheet $*" >>test_grabbag.valgrind.log
34 valgrind
--leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 test_cuesheet
${EXE} $
* 4>>test_grabbag.valgrind.log
36 test_cuesheet
${EXE} $
*
42 if [ x
"$FLAC__TEST_WITH_VALGRIND" = xyes
] ; then
43 echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=50 test_picture $*" >>test_grabbag.valgrind.log
44 valgrind
--leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 test_picture
${EXE} $
* 4>>test_grabbag.valgrind.log
50 if [ `env | grep -ic '^comspec='` != 0 ] ; then
56 ########################################################################
60 ########################################################################
65 echo "Running test_picture..."
69 run_test_picture
$picture_dir >> $log 2>&1
71 if [ $is_win = yes ] ; then
72 diff -w picture.ok
$log > picture.
diff || die
"Error: .log file does not match .ok file, see picture.diff"
74 diff picture.ok
$log > picture.
diff || die
"Error: .log file does not match .ok file, see picture.diff"
77 echo "PASSED (results are in $log)"
79 ########################################################################
83 ########################################################################
86 bad_cuesheets
=cuesheets
/bad.
*.cue
87 good_cuesheets
=cuesheets
/good.
*.cue
88 good_leadout
=`expr 80 \* 60 \* 44100`
89 bad_leadout
=`expr $good_leadout + 1`
91 echo "Running test_cuesheet..."
98 for cuesheet
in $bad_cuesheets ; do
99 echo "NEGATIVE $cuesheet" >> $log 2>&1
100 run_test_cuesheet
$cuesheet $good_leadout 44100 cdda
>> $log 2>&1 || exit_code
=$?
101 if [ "$exit_code" = 255 ] ; then
102 die
"Error: test script is broken"
104 cuesheet_pass1
=${cuesheet}.1
105 cuesheet_pass2
=${cuesheet}.2
106 rm -f $cuesheet_pass1 $cuesheet_pass2
112 for cuesheet
in $good_cuesheets ; do
113 echo "POSITIVE $cuesheet" >> $log 2>&1
114 run_test_cuesheet
$cuesheet $good_leadout 44100 cdda
>> $log 2>&1
116 if [ "$exit_code" = 255 ] ; then
117 die
"Error: test script is broken"
118 elif [ "$exit_code" != 0 ] ; then
119 die
"Error: good cuesheet is broken"
121 cuesheet_pass1
=${cuesheet}.1
122 cuesheet_pass2
=${cuesheet}.2
123 diff $cuesheet_pass1 $cuesheet_pass2 >> $log 2>&1 || die
"Error: pass1 and pass2 output differ"
124 rm -f $cuesheet_pass1 $cuesheet_pass2
127 if [ $is_win = yes ] ; then
128 diff -w cuesheet.ok
$log > cuesheet.
diff || die
"Error: .log file does not match .ok file, see cuesheet.diff"
130 diff cuesheet.ok
$log > cuesheet.
diff || die
"Error: .log file does not match .ok file, see cuesheet.diff"
133 echo "PASSED (results are in $log)"