From 6bb0134ca322b6e50e6ec76a242f89259cd12274 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Mon, 30 Nov 2009 19:34:36 +0000 Subject: Clean up test environment variables, prepare for running more tests in cmake. - consolidate test env vars in test_env.sh, also useful from command line. - generate test_env.sh with autoconf/cmake to cover library location differences. - Remove explicit mention of .libs, use $QPID_MODULE_DIR to load modules. - Fix run_test to run valgrind under cmake git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@885557 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/tests/run_test | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'qpid/cpp/src/tests/run_test') diff --git a/qpid/cpp/src/tests/run_test b/qpid/cpp/src/tests/run_test index 130584ff9b..4b227621bc 100755 --- a/qpid/cpp/src/tests/run_test +++ b/qpid/cpp/src/tests/run_test @@ -32,7 +32,8 @@ # srcdir=`dirname $0` -. $srcdir/vg_check +source ./test_env.sh +source $srcdir/vg_check # Export variables from makefile. export srcdir @@ -59,9 +60,6 @@ VALGRIND_OPTS="$VALGRIND_OPTS --num-callers=25 --log-file=$VG_LOG -- " -# FIXME aconway 2008-07-16: removed --trace-children=yes, problems with cluster tests forking -# qpidd libtool script. Investigate & restore --trace-children if possible. - ERROR=0 if grep -l "^# Generated by .*libtool" "$1" >/dev/null 2>&1; then # This is a libtool "executable". Valgrind it if VALGRIND specified. @@ -69,9 +67,15 @@ if grep -l "^# Generated by .*libtool" "$1" >/dev/null 2>&1; then # Hide output unless there's an error. $LIBTOOL --mode=execute $VALGRIND "$@" 2>&1 || ERROR=1 test -n "$VALGRIND" && { vg_check $VG_LOG* || ERROR=1 ; } -else +elif file $1 | grep -q text; then # This is a non-libtool shell script, just execute it. exec "$@" +else + # This is a real executable, valgrind it. + test -n "$VALGRIND" && VALGRIND="$VALGRIND $VALGRIND_OPTS" + # Hide output unless there's an error. + $VALGRIND "$@" 2>&1 || ERROR=1 + test -n "$VALGRIND" && { vg_check $VG_LOG* || ERROR=1 ; } fi exit $ERROR -- cgit v1.2.1