Commit d3fe7280 authored by Josh Coalson's avatar Josh Coalson
Browse files

split off some tests to new test_flac.sh script

parent 463d0f80
......@@ -39,6 +39,7 @@ TESTS = \
./test_libFLAC.sh \
./test_libFLAC++.sh \
$(OGG_TESTS) \
./test_flac.sh \
./test_metaflac.sh \
./test_grabbag.sh \
./test_streams.sh \
......@@ -51,6 +52,7 @@ EXTRA_DIST = \
test_libFLAC++.sh \
test_libOggFLAC.sh \
test_libOggFLAC++.sh \
test_flac.sh \
test_metaflac.sh \
test_grabbag.sh \
test_streams.sh \
......
......@@ -26,6 +26,7 @@ all: clean
$(FLAC__EXHAUSTIVE_TESTS) $(FLAC__VALGRIND) ./test_libFLAC++.sh
$(FLAC__EXHAUSTIVE_TESTS) $(FLAC__VALGRIND) ./test_libOggFLAC.sh
$(FLAC__EXHAUSTIVE_TESTS) $(FLAC__VALGRIND) ./test_libOggFLAC++.sh
$(FLAC__EXHAUSTIVE_TESTS) $(FLAC__VALGRIND) ./test_flac.sh
$(FLAC__EXHAUSTIVE_TESTS) $(FLAC__VALGRIND) ./test_metaflac.sh
$(FLAC__EXHAUSTIVE_TESTS) $(FLAC__VALGRIND) ./test_grabbag.sh
$(FLAC__EXHAUSTIVE_TESTS) $(FLAC__VALGRIND) ./test_streams.sh
......
......@@ -34,109 +34,15 @@ run_flac ()
}
echo "Generating streams..."
if test_streams ; then : ; else
echo "ERROR during test_streams" 1>&2
exit 1
fi
echo "Checking for --ogg support in flac..."
if flac --ogg wacky1.wav 1>/dev/null 2>&1 ; then
has_ogg=yes;
echo "flac --ogg works"
else
has_ogg=no;
echo "flac --ogg doesn't work"
fi
#
# multi-file tests
#
echo "Generating multiple input files from noise..."
if run_flac --verify --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=16 --channels=2 noise.raw ; then : ; else
echo "ERROR generating FLAC file" 1>&2
exit 1
fi
if run_flac --decode --silent noise.flac ; then : ; else
echo "ERROR generating WAVE file" 1>&2
exit 1
fi
rm -f noise.flac
mv noise.wav file0.wav
cp file0.wav file1.wav
cp file1.wav file2.wav
test_multifile ()
{
streamtype=$1
sector_align=$2
encode_options="$3"
if [ $streamtype = ogg ] ; then
suffix=ogg
encode_options="$encode_options --ogg"
else
suffix=flac
fi
if [ $sector_align = sector_align ] ; then
encode_options="$encode_options --sector-align"
fi
if run_flac $encode_options file0.wav file1.wav file2.wav ; then : ; else
echo "ERROR" 1>&2
if [ ! -f wacky1.wav ] ; then
if test_streams ; then : ; else
echo "ERROR during test_streams" 1>&2
exit 1
fi
for n in 0 1 2 ; do
mv file$n.$suffix file${n}x.$suffix
done
if run_flac --decode file0x.$suffix file1x.$suffix file2x.$suffix ; then : ; else
echo "ERROR" 1>&2
exit 1
fi
if [ $sector_align != sector_align ] ; then
for n in 0 1 2 ; do
if cmp file$n.wav file${n}x.wav ; then : ; else
echo "ERROR: file mismatch on file #$n" 1>&2
exit 1
fi
done
fi
for n in 0 1 2 ; do
rm -f file${n}x.$suffix file${n}x.wav
done
}
echo "Testing multiple files without verify..."
test_multifile flac no_sector_align ""
echo "Testing multiple files with verify..."
test_multifile flac no_sector_align "--verify"
echo "Testing multiple files with --sector-align, without verify..."
test_multifile flac sector_align ""
echo "Testing multiple files with --sector-align, with verify..."
test_multifile flac sector_align "--verify"
if [ $has_ogg = "yes" ] ; then
echo "Testing multiple files with --ogg, without verify..."
test_multifile ogg no_sector_align ""
echo "Testing multiple files with --ogg, with verify..."
test_multifile ogg no_sector_align "--verify"
echo "Testing multiple files with --ogg and --sector-align, without verify..."
test_multifile ogg sector_align ""
echo "Testing multiple files with --ogg and --sector-align, with verify..."
test_multifile sector_align ogg "--verify"
echo "Testing multiple files with --ogg and --serial-number, with verify..."
test_multifile ogg no_sector_align "--serial-number=321 --verify"
fi
#
# single-file tests
# single-file test routines
#
test_file ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment