3 # FLAC - Free Lossless Audio Codec
4 # Copyright (C) 2004,2005 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 if [ x = x"$1" ] ; then
32 LD_LIBRARY_PATH=../src/libFLAC/.libs:$LD_LIBRARY_PATH
33 LD_LIBRARY_PATH=../src/libOggFLAC/.libs:$LD_LIBRARY_PATH
34 LD_LIBRARY_PATH=../obj/$BUILD/lib:$LD_LIBRARY_PATH
35 export LD_LIBRARY_PATH
36 PATH=../src/flac:$PATH
37 PATH=../src/metaflac:$PATH
38 PATH=../src/test_seeking:$PATH
39 PATH=../src/test_streams:$PATH
40 PATH=../obj/$BUILD/bin:$PATH
42 flac --help 1>/dev/null 2>/dev/null || die "ERROR can't find flac executable"
43 metaflac --help 1>/dev/null 2>/dev/null || die "ERROR can't find metaflac executable"
47 if [ x"$FLAC__VALGRIND" = xyes ] ; then
48 valgrind --leak-check=yes --show-reachable=yes --num-callers=100 --logfile-fd=4 flac $* 4>>test_seeking.valgrind.log
56 if [ x"$FLAC__VALGRIND" = xyes ] ; then
57 valgrind --leak-check=yes --show-reachable=yes --num-callers=100 --logfile-fd=4 metaflac $* 4>>test_seeking.valgrind.log
65 if [ x"$FLAC__VALGRIND" = xyes ] ; then
66 valgrind --leak-check=yes --show-reachable=yes --num-callers=100 --logfile-fd=4 test_seeking $* 4>>test_seeking.valgrind.log
72 echo "Checking for --ogg support in flac..."
73 if flac --ogg --silent --force-raw-format --endian=little --sign=signed --channels=1 --bps=8 --sample-rate=44100 -c $0 1>/dev/null 2>&1 ; then
75 echo "flac --ogg works"
78 echo "flac --ogg doesn't work"
82 echo "Generating streams..."
83 if [ ! -f noise.raw ] ; then
84 test_streams || die "ERROR during test_streams"
87 echo "generating FLAC files for seeking:"
88 run_flac --verify --force --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=8 --channels=1 --blocksize=576 --output-name=tiny.flac noise8m32.raw || die "ERROR generating FLAC file"
89 run_flac --verify --force --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=16 --channels=2 --blocksize=576 --output-name=small.flac noise.raw || die "ERROR generating FLAC file"
90 echo "generating Ogg FLAC files for seeking:"
91 run_flac --verify --force --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=8 --channels=1 --blocksize=576 --output-name=tiny.ogg --ogg noise8m32.raw || die "ERROR generating Ogg FLAC file"
92 run_flac --verify --force --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=16 --channels=2 --blocksize=576 --output-name=small.ogg --ogg noise.raw || die "ERROR generating Ogg FLAC file"
94 echo "testing tiny.flac:"
95 if run_test_seeking tiny.flac 100 ; then : ; else
96 die "ERROR: during test_seeking"
99 echo "testing small.flac:"
100 if run_test_seeking small.flac 1000 ; then : ; else
101 die "ERROR: during test_seeking"
104 echo "removing sample count from tiny.flac and small.flac:"
105 if run_metaflac --no-filename --set-total-samples=0 tiny.flac small.flac ; then : ; else
106 die "ERROR: during metaflac"
109 echo "testing tiny.flac with total_samples=0:"
110 if run_test_seeking tiny.flac 100 ; then : ; else
111 die "ERROR: during test_seeking"
114 echo "testing small.flac with total_samples=0:"
115 if run_test_seeking small.flac 1000 ; then : ; else
116 die "ERROR: during test_seeking"
119 if [ $has_ogg = "yes" ] ; then
121 echo "testing tiny.ogg:"
122 if run_test_seeking tiny.ogg 100 ; then : ; else
123 die "ERROR: during test_seeking"
126 echo "testing small.ogg:"
127 if run_test_seeking small.ogg 1000 ; then : ; else
128 die "ERROR: during test_seeking"
133 rm -f tiny.flac tiny.ogg small.flac small.ogg