diff options
author | Gordon Sim <gsim@apache.org> | 2007-01-23 15:12:27 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2007-01-23 15:12:27 +0000 |
commit | b076114507d5c838ecf3d10f1f2dbea78a35f139 (patch) | |
tree | 5c0207d771622cf4c4f26a29ab1433eaed131df4 /cpp/tests/run-python-tests | |
parent | 25a3107550f93fc45002ddd2f6c173893877c649 (diff) | |
download | qpid-python-b076114507d5c838ecf3d10f1f2dbea78a35f139.tar.gz |
Patch from Jim Meyering (jim@meyering.net) submitted on dev list.
Instrument all tests so that they are run via valgrind:
check for both errors and leaks.
* configure.ac: Add new configure options: --enable-valgrind
and --disable-valgrind. For now, the latter is the default.
* README-dev: Document (and recommend) --enable-valgrind.
* tests/.vg-supp: Add many more, from Gordon Sim for FC5.
* configure.ac: Check for valgrind.
* tests/Makefile.am (TESTS_ENVIRONMENT): Export VALGRIND.
* tests/setup: New file.
* tests/run-unit-tests: Use new "setup" file.
Invoke DllPlugInTester via $vg (aka valgrind).
Refer to the source directory using $pwd, since we're now running
from a temporary subdirectory.
* tests/run-python-tests: Remove traps. That is now done by "setup".
[VERBOSE]: Print qpidd --version.
Invoke qpidd via $vg and its absolute name.
Add a kludgey "sleep 3", because it can take a while for libtool
to start valgrind to start qpidd, in the background.
Ideally, the python script would simply sleep-0.3-and-retry for
a couple seconds, upon failure of the initial connection attempt.
* tests/.vg-supp: New file, exempting known leaks on Debian/unstable.
Some of these leaks appear to be legitimate.
* tests/Makefile.am (EXTRA_DIST): Add .vg-supp and setup.
* qpid-autotools-install (usage): Add a missing backslash.
Fix "make distcheck" failure.
* docs/api/Makefile.am (EXTRA_DIST): Add user.doxygen
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@499049 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/tests/run-python-tests')
-rwxr-xr-x | cpp/tests/run-python-tests | 38 |
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 |