summaryrefslogtreecommitdiff
path: root/cpp/tests/run-python-tests
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/tests/run-python-tests')
-rwxr-xr-xcpp/tests/run-python-tests38
1 files changed, 29 insertions, 9 deletions
diff --git a/cpp/tests/run-python-tests b/cpp/tests/run-python-tests
index 57be07ec1c..d9b78e1055 100755
--- a/cpp/tests/run-python-tests
+++ b/cpp/tests/run-python-tests
@@ -1,15 +1,35 @@
-#!/bin/sh
+#!/bin/bash
+
+if test "$VERBOSE" = yes; then
+ set -x
+ qpidd --version
+fi
+
+. $srcdir/setup
+
+fail=0
+pid=0
-set -e
-log=`pwd`/qpidd.log
# Start the daemon, recording its PID.
-../src/qpidd > $log 2>&1 & pid=$!
+$vg $abs_builddir/../src/qpidd > log 2>&1 & pid=$!
-# Arrange to kill the daemon upon any type of termination.
-trap 'status=$?; kill $pid; exit $status' 0
-trap '(exit $?); exit $?' 1 2 13 15
+# FIXME: remove this sleep kludge once qpidd provides a way
+sleep 4
# Run the tests.
-cd ../../python && ./run-tests -v -I cpp_failing.txt
+( cd $abs_srcdir/../../python \
+ && python ./run-tests -v -I cpp_failing.txt || fail=1 )
+
+kill $pid || { echo FAIL: process already died; cat log; fail=1; }
+
+wait $pid
+# FIXME: when we have a way to make qpidd shutdown gracefully
+# (i.e. with expected exit status of 0), replace the above with this:
+# wait $pid || fail=1
+
+vg_check log || fail=1
+
+# Tell the exit trap not to kill any process.
+pid=0
-rm -f $log
+(exit $fail); exit $fail