diff options
author | Alan Conway <aconway@apache.org> | 2008-06-26 14:55:48 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-06-26 14:55:48 +0000 |
commit | 9ca5eeb1dd5dc4b97f5384439b890db938d83c53 (patch) | |
tree | e48575a82516337d8e6be6d8c676b270b1fde28c | |
parent | be611b9882ba32bf16090b5a38f474c14bb5ec72 (diff) | |
download | qpid-python-9ca5eeb1dd5dc4b97f5384439b890db938d83c53.tar.gz |
Use run_test to run valgrind for start_broker consistently with other tests.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@671916 13f79535-47bb-0310-9956-ffa450edef68
-rwxr-xr-x | cpp/src/tests/run_test | 15 | ||||
-rwxr-xr-x | cpp/src/tests/start_broker | 6 | ||||
-rwxr-xr-x | cpp/src/tests/stop_broker | 4 |
3 files changed, 10 insertions, 15 deletions
diff --git a/cpp/src/tests/run_test b/cpp/src/tests/run_test index 06e919c394..b87e4fccbd 100755 --- a/cpp/src/tests/run_test +++ b/cpp/src/tests/run_test @@ -29,7 +29,7 @@ test -z "$LC_COLLATE" && LC_COLLATE= test -z "$LC_MESSAGES" && LC_MESSAGES= export LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES -VG_LOG="$1.vglog" +VG_LOG="`basename $1`.vglog" rm -f $VG_LOG* VALGRIND_OPTS=" @@ -46,17 +46,12 @@ 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=$? - test -n "$VALGRIND" && vg_check $VG_LOG* + libtool --mode=execute $VALGRIND "$@" 2>&1 || ERROR=1 + test -n "$VALGRIND" && { vg_check $VG_LOG* || ERROR=1 ; } else # This is a non-libtool shell script, just execute it. exec "$@" fi -if test -z "$ERROR"; then - # Clean up logs if there was no error. - rm -f $VG_LOG* - exit 0 -else - exit $ERROR -fi +exit $ERROR + diff --git a/cpp/src/tests/start_broker b/cpp/src/tests/start_broker index e579ff586c..aabe12ad43 100755 --- a/cpp/src/tests/start_broker +++ b/cpp/src/tests/start_broker @@ -1,4 +1,4 @@ #!/bin/sh -rm -f qpidd.vglog* qpidd.log -test -n "$VALGRIND" && VALGRIND="$VALGRIND --log-file=qpidd.vglog --" -exec libtool --mode=execute $VALGRIND ../qpidd --auth no --no-module-dir --daemon --port 0 --log-output qpidd.log "$@" > qpidd.port +# Start a test broker. +srcdir=`dirname $0` +exec $srcdir/run_test ../qpidd --auth=no --no-module-dir --daemon --port=0 --log-output qpidd.log "$@" > qpidd.port diff --git a/cpp/src/tests/stop_broker b/cpp/src/tests/stop_broker index 9b3ef5db5b..0e67ac24dd 100755 --- a/cpp/src/tests/stop_broker +++ b/cpp/src/tests/stop_broker @@ -4,7 +4,7 @@ export QPID_PORT=`cat qpidd.port` rm -f qpidd.port -../qpidd --quit || ERROR=$? +../qpidd --quit || ERROR=1 # Check qpidd.log. grep -a 'warning\|error\|critical' qpidd.log && { @@ -14,7 +14,7 @@ grep -a 'warning\|error\|critical' qpidd.log && { # Check valgrind log. if test -n "$VALGRIND"; then source `dirname $0`/vg_check $VG_LOG* - vg_check qpidd.vglog* + vg_check qpidd.vglog* || ERROR=1 fi exit $ERROR |