summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests/run_test
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2013-10-24 15:00:11 +0000
committerAndrew Stitcher <astitcher@apache.org>2013-10-24 15:00:11 +0000
commit96cb698658efdadeaa97b6f896d270fc04330822 (patch)
tree71b07c8e906b3808fa848def0f52117b6386feee /qpid/cpp/src/tests/run_test
parent9dffceae68b8d8bc36a2de08abcbd8554db3e309 (diff)
downloadqpid-python-96cb698658efdadeaa97b6f896d270fc04330822.tar.gz
QPID-4927: Get cmake testing working with valgrind
[also remove unused files] git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1535398 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/run_test')
-rwxr-xr-xqpid/cpp/src/tests/run_test27
1 files changed, 9 insertions, 18 deletions
diff --git a/qpid/cpp/src/tests/run_test b/qpid/cpp/src/tests/run_test
index 6ec1fd892b..16e7362d5a 100755
--- a/qpid/cpp/src/tests/run_test
+++ b/qpid/cpp/src/tests/run_test
@@ -42,13 +42,6 @@ export srcdir
test -s qpidd.port && QPID_PORT=`cat qpidd.port`
export QPID_PORT
-# Avoid silly libtool error messages if these are not defined
-test -z "$LC_ALL" && LC_ALL=
-test -z "$LC_CTYPE" && LC_CTYPE=
-test -z "$LC_COLLATE" && LC_COLLATE=
-test -z "$LC_MESSAGES" && LC_MESSAGES=
-export LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
-
VG_LOG="`basename $1`.vglog"
rm -f $VG_LOG*
@@ -61,21 +54,19 @@ VALGRIND_OPTS="$VALGRIND_OPTS
--log-file=$VG_LOG --
"
ERROR=0
-if grep -l "^# Generated by .*libtool" "$1" >/dev/null 2>&1; then
- # This is a libtool "executable". Valgrind it if VALGRIND specified.
- test -n "$VALGRIND" && VALGRIND="$VALGRIND $VALGRIND_OPTS"
- # Hide output unless there's an error.
- $LIBTOOL --mode=execute $VALGRIND "$@" 2>&1 || ERROR=1
- test -n "$VALGRIND" && { vg_check $VG_LOG* || ERROR=1 ; }
+if [ ! -x $1 ] ; then
+ echo "Cannot execute $1"
+ ERROR=1
elif file $1 | grep -q text; then
- # This is a non-libtool shell script, just execute it.
+ # This is a shell script, just execute it.
exec "$@"
-else
+elif [ -n "$VALGRIND" ] ; then
# 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 ; }
+ $VALGRIND $VALGRIND_OPTS "$@" 2>&1 || ERROR=1
+ vg_check $VG_LOG* || ERROR=1
+else
+ "$@" 2>&1 || ERROR=1
fi
exit $ERROR