Commit efaab3c8 authored by Erik de Castro Lopo's avatar Erik de Castro Lopo
Browse files

test/ : Use more portable echo constructs

Fix suggested by Daniel Macks.

Closes: https://sourceforge.net/p/flac/bugs/433/
parent 33a73fcb
......@@ -16,7 +16,7 @@
# restrictive of those mentioned above. See the file COPYING.Xiph in this
# distribution.
TESTS_ENVIRONMENT = FLAC__TEST_LEVEL=@FLAC__TEST_LEVEL@ FLAC__TEST_WITH_VALGRIND=@FLAC__TEST_WITH_VALGRIND@
TESTS_ENVIRONMENT = FLAC__TEST_LEVEL=@FLAC__TEST_LEVEL@ FLAC__TEST_WITH_VALGRIND=@FLAC__TEST_WITH_VALGRIND@ ECHO_N="@ECHO_N@" ECHO_C="@ECHO_C@"
SUBDIRS = cuesheets flac-to-flac-metadata-test-files metaflac-test-files pictures
......
......@@ -49,13 +49,13 @@ test_file ()
bps=$3
encode_options="$4"
echo -n "$name.bin (--channels=$channels --bps=$bps $encode_options): encode..."
echo $ECHO_N "$name.bin (--channels=$channels --bps=$bps $encode_options): encode..." $ECHO_C
cmd="run_flac --verify --silent --force --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=$bps --channels=$channels $encode_options --no-padding $name.bin"
echo "### ENCODE $name #######################################################" >> ./streams.log
echo "### cmd=$cmd" >> ./streams.log
$cmd 2>>./streams.log || die "ERROR during encode of $name"
echo -n "decode..."
echo $ECHO_N "decode..." $ECHO_C
cmd="run_flac --silent --force --endian=big --sign=signed --decode --force-raw-format $name.flac";
echo "### DECODE $name #######################################################" >> ./streams.log
echo "### cmd=$cmd" >> ./streams.log
......@@ -65,7 +65,7 @@ test_file ()
ls -1l $name.flac >> ./streams.log
ls -1l $name.raw >> ./streams.log
echo -n "compare..."
echo $ECHO_N "compare..." $ECHO_C
cmp $name.bin $name.raw || die "ERROR during compare of $name"
echo OK
......
This diff is collapsed.
......@@ -103,7 +103,7 @@ metaflac_test ()
desc="$2"
args="$3"
expect="$case-expect.meta"
echo -n "test $1: $desc... "
echo $ECHO_N "test $1: $desc... " $ECHO_C
run_metaflac $args $flacfile | filter > $testdir/out.meta || die "ERROR running metaflac"
diff -w $expect $testdir/out.meta > /dev/null 2>&1 || die "ERROR: metadata does not match expected $expect"
echo OK
......@@ -339,13 +339,13 @@ done
[ $ncase = 60 ] || die "expected case# to be 60"
fn=export-picture-check
echo -n "Testing --export-picture-to... "
echo $ECHO_N "Testing --export-picture-to... " $ECHO_C
run_metaflac --export-picture-to=$fn $flacfile
check_flac
cmp $fn ${top_srcdir}/test/pictures/0.gif || die "ERROR, exported picture file and original differ"
echo OK
rm -f $fn
echo -n "Testing --block-number --export-picture-to... "
echo $ECHO_N "Testing --block-number --export-picture-to... " $ECHO_C
run_metaflac --block-number=9 --export-picture-to=$fn $flacfile
check_flac
cmp $fn ${top_srcdir}/test/pictures/0.png || die "ERROR, exported picture file and original differ"
......@@ -363,7 +363,7 @@ check_flac
metaflac_test case62 "--import-picture-from" "--list"
# UNKNOWN blocks
echo -n "Testing FLAC file with unknown metadata... "
echo $ECHO_N "Testing FLAC file with unknown metadata... " $ECHO_C
cp -p ${top_srcdir}/test/metaflac.flac.in $flacfile
# remove the VORBIS_COMMENT block so vendor string changes don't interfere with the comparison:
run_metaflac --remove --block-type=VORBIS_COMMENT --dont-use-padding $flacfile
......
......@@ -124,7 +124,7 @@ for ACTION in $REPLAYGAIN_FREQ ; do
fi
RATE=$(($MULTIPLE * FREQ))
[ $MULTIPLE -eq 1 -o -n "${REPLAYGAIN_FREQ##* $RATE/*}" ] || break
echo -n "Testing FLAC replaygain $RATE ($FREQ x $MULTIPLE) ... "
echo $ECHO_N "Testing FLAC replaygain $RATE ($FREQ x $MULTIPLE) ... " $ECHO_C
tonegenerator $RATE $flacfile
run_metaflac --scan-replay-gain $flacfile
run_metaflac --add-replay-gain $flacfile
......
......@@ -63,7 +63,7 @@ run_test_seeking ()
fi
}
echo -n "Checking for --ogg support in flac ... "
echo $ECHO_N "Checking for --ogg support in flac ... " $ECHO_C
if flac${EXE} --ogg --no-error-on-compression-fail --silent --force-raw-format --endian=little --sign=signed --channels=1 --bps=8 --sample-rate=44100 -c $0 1>/dev/null 2>&1 ; then
has_ogg=yes;
else
......
......@@ -56,13 +56,13 @@ test_file ()
bps=$3
encode_options="$4"
echo -n "$name (--channels=$channels --bps=$bps $encode_options): encode..."
echo $ECHO_N "$name (--channels=$channels --bps=$bps $encode_options): encode..." $ECHO_C
cmd="run_flac --verify --silent --force --force-raw-format --endian=little --sign=signed --sample-rate=44100 --bps=$bps --channels=$channels $encode_options --no-padding $name.raw"
echo "### ENCODE $name #######################################################" >> ./streams.log
echo "### cmd=$cmd" >> ./streams.log
$cmd 2>>./streams.log || die "ERROR during encode of $name"
echo -n "decode..."
echo $ECHO_N "decode..." $ECHO_C
cmd="run_flac --silent --force --endian=little --sign=signed --decode --force-raw-format --output-name=$name.cmp $name.flac"
echo "### DECODE $name #######################################################" >> ./streams.log
echo "### cmd=$cmd" >> ./streams.log
......@@ -72,7 +72,7 @@ test_file ()
ls -1l $name.flac >> ./streams.log
ls -1l $name.cmp >> ./streams.log
echo -n "compare..."
echo $ECHO_N "compare..." $ECHO_C
cmp $name.raw $name.cmp || die "ERROR during compare of $name"
echo OK
......@@ -91,7 +91,7 @@ test_file_piped ()
is_win=no
fi
echo -n "$name: encode via pipes..."
echo $ECHO_N "$name: encode via pipes..." $ECHO_C
if [ $is_win = yes ] ; then
cmd="run_flac --verify --silent --force --force-raw-format --endian=little --sign=signed --sample-rate=44100 --bps=$bps --channels=$channels $encode_options --no-padding --stdout $name.raw"
echo "### ENCODE $name #######################################################" >> ./streams.log
......@@ -103,7 +103,7 @@ test_file_piped ()
echo "### cmd=$cmd" >> ./streams.log
cat $name.raw | $cmd 1>$name.flac 2>>./streams.log || die "ERROR during encode of $name"
fi
echo -n "decode via pipes..."
echo $ECHO_N "decode via pipes..." $ECHO_C
if [ $is_win = yes ] ; then
cmd="run_flac --silent --force --endian=little --sign=signed --decode --force-raw-format --stdout $name.flac"
echo "### DECODE $name #######################################################" >> ./streams.log
......@@ -119,7 +119,7 @@ test_file_piped ()
ls -1l $name.flac >> ./streams.log
ls -1l $name.cmp >> ./streams.log
echo -n "compare..."
echo $ECHO_N "compare..." $ECHO_C
cmp $name.raw $name.cmp || die "ERROR during compare of $name"
echo OK
......
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