From d3fe72801aa6133006175da5ac60871e8ad2680c Mon Sep 17 00:00:00 2001 From: Josh Coalson Date: Tue, 10 Dec 2002 06:42:15 +0000 Subject: [PATCH] split off some tests to new test_flac.sh script --- test/Makefile.am | 2 + test/Makefile.lite | 1 + test/test_streams.sh | 102 ++------------------------------------------------- 3 files changed, 7 insertions(+), 98 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index 987f930..4d7182c 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -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 \ diff --git a/test/Makefile.lite b/test/Makefile.lite index b4ed0e1..7566ba9 100644 --- a/test/Makefile.lite +++ b/test/Makefile.lite @@ -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 diff --git a/test/test_streams.sh b/test/test_streams.sh index f4dc2e2..c0aa964 100755 --- a/test/test_streams.sh +++ b/test/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 () -- 2.7.4