summaryrefslogtreecommitdiff
path: root/test/test_seeking.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_seeking.sh
parent1d3d50a9185462b1ec25f1902ccfba9c589f2a65 (diff)
downloadflac-a9712a2279f6d1a7b4902170b0b1795fff19d00d.tar.gz
Factor out common test functionality to test/common.sh.in.
Diffstat (limited to 'test/test_seeking.sh')
-rwxr-xr-xtest/test_seeking.sh37
1 files changed, 11 insertions, 26 deletions
diff --git a/test/test_seeking.sh b/test/test_seeking.sh
index 3386ff25..7da5523e 100755
--- a/test/test_seeking.sh
+++ b/test/test_seeking.sh
@@ -18,23 +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
+source common.sh
-LD_LIBRARY_PATH=../src/libFLAC/.libs:$LD_LIBRARY_PATH
-LD_LIBRARY_PATH=../objs/$BUILD/lib:$LD_LIBRARY_PATH
-export LD_LIBRARY_PATH
-export MALLOC_CHECK_=3
-export MALLOC_PERTURB_=$((RANDOM % 255 + 1))
PATH=../src/flac:$PATH
PATH=../src/metaflac:$PATH
PATH=../src/test_seeking:$PATH
@@ -45,16 +30,16 @@ if [ x"$FLAC__TEST_LEVEL" = x ] ; then
FLAC__TEST_LEVEL=1
fi
-flac --help 1>/dev/null 2>/dev/null || die "ERROR can't find flac executable"
-metaflac --help 1>/dev/null 2>/dev/null || die "ERROR can't find metaflac executable"
+flac${EXE} --help 1>/dev/null 2>/dev/null || die "ERROR can't find flac executable"
+metaflac${EXE} --help 1>/dev/null 2>/dev/null || die "ERROR can't find metaflac executable"
run_flac ()
{
if [ x"$FLAC__TEST_WITH_VALGRIND" = xyes ] ; then
echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=50 flac $*" >>test_seeking.valgrind.log
- valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 flac --no-error-on-compression-fail $* 4>>test_seeking.valgrind.log
+ valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 flac${EXE} --no-error-on-compression-fail $* 4>>test_seeking.valgrind.log
else
- flac --no-error-on-compression-fail $*
+ flac${EXE} --no-error-on-compression-fail $*
fi
}
@@ -62,9 +47,9 @@ run_metaflac ()
{
if [ x"$FLAC__TEST_WITH_VALGRIND" = xyes ] ; then
echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=50 metaflac $*" >>test_seeking.valgrind.log
- valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 metaflac $* 4>>test_seeking.valgrind.log
+ valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 metaflac${EXE} $* 4>>test_seeking.valgrind.log
else
- metaflac $*
+ metaflac${EXE} $*
fi
}
@@ -74,12 +59,12 @@ run_test_seeking ()
echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=50 test_seeking $*" >>test_seeking.valgrind.log
valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 test_seeking $* 4>>test_seeking.valgrind.log
else
- test_seeking $*
+ test_seeking${EXE} $*
fi
}
echo -n "Checking for --ogg support in flac ... "
-if flac --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
+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
has_ogg=no;
@@ -97,8 +82,8 @@ run_flac --verify --force --silent --force-raw-format --endian=big --sign=signed
run_flac --verify --force --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=8 --channels=1 --blocksize=576 -S10x --output-name=tiny-s.flac noise8m32.raw || die "ERROR generating FLAC file"
run_flac --verify --force --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=16 --channels=2 --blocksize=576 -S10x --output-name=small-s.flac noise.raw || die "ERROR generating FLAC file"
-tiny_samples=`metaflac --show-total-samples tiny.flac`
-small_samples=`metaflac --show-total-samples small.flac`
+tiny_samples=`metaflac${EXE} --show-total-samples tiny.flac`
+small_samples=`metaflac${EXE} --show-total-samples small.flac`
tiny_seek_count=100
if [ "$FLAC__TEST_LEVEL" -gt 1 ] ; then