summaryrefslogtreecommitdiff
path: root/test/test_replaygain.sh
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2013-09-16 19:55:11 +1000
committerErik de Castro Lopo <erikd@mega-nerd.com>2013-09-17 06:14:57 +1000
commita9712a2279f6d1a7b4902170b0b1795fff19d00d (patch)
tree36723d71d79d96cf61a9d580fc283ae4aacf8c8d /test/test_replaygain.sh
parent1d3d50a9185462b1ec25f1902ccfba9c589f2a65 (diff)
downloadflac-a9712a2279f6d1a7b4902170b0b1795fff19d00d.tar.gz
Factor out common test functionality to test/common.sh.in.
Diffstat (limited to 'test/test_replaygain.sh')
-rwxr-xr-xtest/test_replaygain.sh41
1 files changed, 6 insertions, 35 deletions
diff --git a/test/test_replaygain.sh b/test/test_replaygain.sh
index d77e78e8..a847983d 100755
--- a/test/test_replaygain.sh
+++ b/test/test_replaygain.sh
@@ -18,37 +18,8 @@
# restrictive of those mentioned above. See the file COPYING.Xiph in this
# distribution.
-die ()
-{
- echo $* 1>&2
- exit 1
-}
-
-if [ x = x"$1" ] ; then
- BUILD=debug
-else
- BUILD="$1"
-fi
-
-# change to 'false' to show all flac/metaflac output (useful for debugging)
-if true ; then
- SILENT='--silent'
- TOTALLY_SILENT='--totally-silent'
-else
- SILENT=''
- TOTALLY_SILENT=''
-fi
+source common.sh
-LD_LIBRARY_PATH=`pwd`/../src/libFLAC/.libs:$LD_LIBRARY_PATH
-LD_LIBRARY_PATH=`pwd`/../src/share/grabbag/.libs:$LD_LIBRARY_PATH
-LD_LIBRARY_PATH=`pwd`/../src/share/getopt/.libs:$LD_LIBRARY_PATH
-LD_LIBRARY_PATH=`pwd`/../src/share/replaygain_analysis/.libs:$LD_LIBRARY_PATH
-LD_LIBRARY_PATH=`pwd`/../src/share/replaygain_synthesis/.libs:$LD_LIBRARY_PATH
-LD_LIBRARY_PATH=`pwd`/../src/share/utf8/.libs:$LD_LIBRARY_PATH
-LD_LIBRARY_PATH=`pwd`/../objs/$BUILD/lib:$LD_LIBRARY_PATH
-export LD_LIBRARY_PATH
-export MALLOC_CHECK_=3
-export MALLOC_PERTURB_=$(($(date +%s) % 255 + 1))
PATH=`pwd`/../src/flac:$PATH
PATH=`pwd`/../src/metaflac:$PATH
PATH=`pwd`/../objs/$BUILD/bin:$PATH
@@ -67,7 +38,7 @@ run_flac ()
echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=50 flac $*" >>test_replaygain.valgrind.log
valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 flac --no-error-on-compression-fail $* 4>>test_replaygain.valgrind.log
else
- flac --no-error-on-compression-fail $*
+ flac${EXE} --no-error-on-compression-fail $*
fi
}
@@ -77,7 +48,7 @@ run_metaflac ()
echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=50 metaflac $*" >>test_replaygain.valgrind.log
valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 metaflac $* 4>>test_replaygain.valgrind.log
else
- metaflac $*
+ metaflac${EXE} $*
fi
}
@@ -90,7 +61,7 @@ run_metaflac_silent ()
echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=50 metaflac $*" >>test_replaygain.valgrind.log
valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 metaflac $* 2>/dev/null 4>>test_replaygain.valgrind.log
else
- metaflac $* 2>/dev/null
+ metaflac${EXE} $* 2>/dev/null
fi
fi
}
@@ -102,7 +73,7 @@ check_flac ()
echo "Generating stream..."
bytes=80000
-if dd if=/dev/zero ibs=1 count=$bytes | flac --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 | 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
chmod +w $flacfile
else
die "ERROR during generation"
@@ -157,7 +128,7 @@ tonegenerator ()
}
}' /dev/null |
- flac --silent --no-error-on-compression-fail \
+ flac${EXE} --silent --no-error-on-compression-fail \
--endian=big --channels=1 --bps=24 --sample-rate=$1 --sign=unsigned -
}