summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2015-02-15 17:02:14 +1100
committerErik de Castro Lopo <erikd@mega-nerd.com>2015-02-15 20:37:40 +1100
commited22a42bbec2e8531ebcdd481a989080be6a1fce (patch)
treec72b029d5ff17eb4ca2d1d4384add4726476deef /test
parentd8036ea9d60664e74300ce0973774fc69dd66e86 (diff)
downloadflac-ed22a42bbec2e8531ebcdd481a989080be6a1fce.tar.gz
test/test_metaflac.sh : Out-of-tree build fixes.
Diffstat (limited to 'test')
-rwxr-xr-xtest/test_metaflac.sh34
1 files changed, 17 insertions, 17 deletions
diff --git a/test/test_metaflac.sh b/test/test_metaflac.sh
index f5fc7102..bfa6610f 100755
--- a/test/test_metaflac.sh
+++ b/test/test_metaflac.sh
@@ -39,9 +39,9 @@ run_flac ()
{
if [ x"$FLAC__TEST_WITH_VALGRIND" = xyes ] ; then
echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=50 flac $*" >>test_metaflac.valgrind.log
- valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 flac${EXE} --no-error-on-compression-fail $* 4>>test_metaflac.valgrind.log
+ valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 flac${EXE} ${TOTALLY_SILENT} --no-error-on-compression-fail $* 4>>test_metaflac.valgrind.log
else
- flac${EXE} --no-error-on-compression-fail $*
+ flac${EXE} ${TOTALLY_SILENT} --no-error-on-compression-fail $*
fi
}
@@ -76,7 +76,7 @@ check_flac ()
echo "Generating stream..."
bytes=80000
-if dd if=/dev/zero ibs=1 count=$bytes | flac${EXE} --force --verify -0 --input-size=$bytes --output-name=$flacfile --force-raw-format --endian=big --sign=signed --channels=1 --bps=8 --sample-rate=8000 - ; then
+if dd if=/dev/zero ibs=1 count=$bytes 2>/dev/null | flac${EXE} ${TOTALLY_SILENT} --force --verify -0 --input-size=$bytes --output-name=$flacfile --force-raw-format --endian=big --sign=signed --channels=1 --bps=8 --sample-rate=8000 - ; then
chmod +w $flacfile
else
die "ERROR during generation"
@@ -84,7 +84,7 @@ fi
check_flac
-echo
+testdatadir=${top_srcdir}/test/metaflac-test-files
filter ()
{
@@ -99,11 +99,11 @@ filter ()
}
metaflac_test ()
{
- case="$1"
+ case="$testdatadir/$1"
desc="$2"
args="$3"
- expect="$testdir/$case-expect.meta"
- echo -n "test $case: $desc... "
+ expect="$case-expect.meta"
+ echo -n "test $1: $desc... "
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
@@ -275,7 +275,7 @@ check_flac
metaflac_test case42 "--remove-replay-gain" "--list"
# CUESHEET blocks
-cs_in=cuesheets/good.000.cue
+cs_in=${top_srcdir}/test/cuesheets/good.000.cue
cs_out=metaflac.cue
cs_out2=metaflac2.cue
run_metaflac --import-cuesheet-from="$cs_in" $flacfile
@@ -302,7 +302,7 @@ for f in \
1.gif \
2.gif \
; do
- run_metaflac --import-picture-from="|image/gif|$f||pictures/$f" $flacfile
+ run_metaflac --import-picture-from="|image/gif|$f||${top_srcdir}/test/pictures/$f" $flacfile
check_flac
metaflac_test "case$ncase" "--import-picture-from" "--list"
ncase=`expr $ncase + 1`
@@ -311,7 +311,7 @@ for f in \
0.jpg \
4.jpg \
; do
- run_metaflac --import-picture-from="4|image/jpeg|$f||pictures/$f" $flacfile
+ run_metaflac --import-picture-from="4|image/jpeg|$f||${top_srcdir}/test/pictures/$f" $flacfile
check_flac
metaflac_test "case$ncase" "--import-picture-from" "--list"
ncase=`expr $ncase + 1`
@@ -327,7 +327,7 @@ for f in \
7.png \
8.png \
; do
- run_metaflac --import-picture-from="5|image/png|$f||pictures/$f" $flacfile
+ run_metaflac --import-picture-from="5|image/png|$f||${top_srcdir}/test/pictures/$f" $flacfile
check_flac
metaflac_test "case$ncase" "--import-picture-from" "--list"
ncase=`expr $ncase + 1`
@@ -338,30 +338,30 @@ fn=export-picture-check
echo -n "Testing --export-picture-to... "
run_metaflac --export-picture-to=$fn $flacfile
check_flac
-cmp $fn pictures/0.gif || die "ERROR, exported picture file and original differ"
+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... "
run_metaflac --block-number=9 --export-picture-to=$fn $flacfile
check_flac
-cmp $fn pictures/0.png || die "ERROR, exported picture file and original differ"
+cmp $fn ${top_srcdir}/test/pictures/0.png || die "ERROR, exported picture file and original differ"
echo OK
rm -f $fn
run_metaflac --remove --block-type=PICTURE $flacfile
check_flac
metaflac_test case60 "--remove --block-type=PICTURE" "--list"
-run_metaflac --import-picture-from="1|image/png|standard_icon|32x32x24|pictures/0.png" $flacfile
+run_metaflac --import-picture-from="1|image/png|standard_icon|32x32x24|${top_srcdir}/test/pictures/0.png" $flacfile
check_flac
metaflac_test case61 "--import-picture-from" "--list"
-run_metaflac --import-picture-from="2|image/png|icon|64x64x24|pictures/1.png" $flacfile
+run_metaflac --import-picture-from="2|image/png|icon|64x64x24|${top_srcdir}/test/pictures/1.png" $flacfile
check_flac
metaflac_test case62 "--import-picture-from" "--list"
# UNKNOWN blocks
echo -n "Testing FLAC file with unknown metadata... "
-cp -p metaflac.flac.in $flacfile
+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
-cmp $flacfile metaflac.flac.ok || die "ERROR, $flacfile and metaflac.flac.ok differ"
+cmp $flacfile ${top_srcdir}/test/metaflac.flac.ok || die "ERROR, $flacfile and metaflac.flac.ok differ"
echo OK