Factor out common test functionality to test/common.sh.in.

This commit is contained in:
Erik de Castro Lopo
2013-09-16 19:55:11 +10:00
parent 1d3d50a918
commit a9712a2279
13 changed files with 128 additions and 253 deletions

View File

@@ -18,22 +18,8 @@
# restrictive of those mentioned above. See the file COPYING.Xiph in this
# distribution.
die ()
{
echo $* 1>&2
exit 1
}
source common.sh
if [ x = x"$1" ] ; then
BUILD=debug
else
BUILD="$1"
fi
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/test_streams:$PATH
PATH=../objs/$BUILD/bin:$PATH
@@ -42,7 +28,7 @@ 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"
flac${EXE} --help 1>/dev/null 2>/dev/null || die "ERROR can't find flac executable"
run_flac ()
{
@@ -50,7 +36,7 @@ run_flac ()
echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=50 flac $*" >>test_streams.valgrind.log
valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 flac --no-error-on-compression-fail $* 4>>test_streams.valgrind.log
else
flac --no-error-on-compression-fail $*
flac${EXE} --no-error-on-compression-fail $*
fi
}