From 6a6d08830564ff2ae17ccf33a685937abec95780 Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Sun, 27 Sep 2009 11:50:12 +1000 Subject: [PATCH] Update to allow all tests to be gathered up into a testsuite tarball and then be run using this script. --- ChangeLog | 6 ++++++ tests/test_wrapper.sh.in | 27 ++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 47931ea4..d5d111e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-09-27 Erik de Castro Lopo + + * tests/test_wrapper.sh.in + Update to allow all tests to be gathered up into a testsuite tarball and + then be run using this script. + 2009-09-26 Erik de Castro Lopo * src/common.h src/*.c diff --git a/tests/test_wrapper.sh.in b/tests/test_wrapper.sh.in index 2f92dc82..f5500e91 100644 --- a/tests/test_wrapper.sh.in +++ b/tests/test_wrapper.sh.in @@ -1,5 +1,8 @@ #!/bin/sh +PACKAGE_VERSION=@PACKAGE_VERSION@ +LIB_VERSION=`echo $PACKAGE_VERSION | sed "s/[a-z].*//"` + if test -f tests/sfversion@EXEEXT@ ; then cd tests fi @@ -9,13 +12,35 @@ if test ! -f sfversion@EXEEXT@ ; then exit 1 fi +if test -f libsndfile.so.$LIB_VERSION ; then + export LD_LIBRARY_PATH=`pwd` + if test ! -f libsndfile.so.1 ; then + ln -s libsndfile.so.$LIB_VERSION libsndfile.so.1 + fi + fi + sfversion=`./sfversion@EXEEXT@` +if test $sfversion != libsndfile-$PACKAGE_VERSION ; then + echo "Error : sfversion ($sfversion) and PACKAGE_VERSION ($PACKAGE_VERSION) don't match." + exit 1 + fi + # Force exit on errors. set -e -# generic-tests +# Generic-tests uname -a + +# Need this for when we're running from files collected into the +# libsndfile-testsuite-@PACKAGE_VERSION@ tarball. +if test -x test_main@EXEEXT@ ; then + echo "Running unit tests from src/ directory of source code tree." + ./test_main@EXEEXT@ + echo + echo "Running end-to-end tests from tests/ directory." + fi + ./error_test@EXEEXT@ ./pcm_test@EXEEXT@ ./ulaw_test@EXEEXT@