summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-06-26 19:33:00 +0000
committerAlan Conway <aconway@apache.org>2007-06-26 19:33:00 +0000
commit2e15ee024a7f47bda7bd6ea5991657a820bd0714 (patch)
treee40f85c648e557d68bc0436d1bbcb42a3712ceb0 /cpp
parent3354535849812a62c00bc568ea9df51cf6153e0d (diff)
downloadqpid-python-2e15ee024a7f47bda7bd6ea5991657a820bd0714.tar.gz
* src/tests/cluster.mk: Replace sudo with newgrp for ais tests.
Skip ais tests with warning if user is not in ais group. * src/tests/Makefile.am: Enable valgrind for all tests. * src/qpid/client/Connector.cpp: Fix memory leak. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@550915 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/qpid/client/Connector.cpp4
-rw-r--r--cpp/src/tests/Makefile.am7
-rw-r--r--cpp/src/tests/cluster.mk16
3 files changed, 14 insertions, 13 deletions
diff --git a/cpp/src/qpid/client/Connector.cpp b/cpp/src/qpid/client/Connector.cpp
index 18cb0e064b..99f2d6ece1 100644
--- a/cpp/src/qpid/client/Connector.cpp
+++ b/cpp/src/qpid/client/Connector.cpp
@@ -46,7 +46,9 @@ Connector::Connector(
outbuf(send_buffer_size)
{ }
-Connector::~Connector(){ }
+Connector::~Connector(){
+ receiver.join();
+}
void Connector::connect(const std::string& host, int port){
socket = Socket::createTcp();
diff --git a/cpp/src/tests/Makefile.am b/cpp/src/tests/Makefile.am
index 60290ee2da..9b15b68c04 100644
--- a/cpp/src/tests/Makefile.am
+++ b/cpp/src/tests/Makefile.am
@@ -89,12 +89,7 @@ testprogs = \
check_PROGRAMS += $(unit_progs) $(testprogs) interop_runner
-# FIXME aconway 2007-05-30: TESTS_ENVIRONMENT should have ./run_test
-# as below to run valgrind on all test programs.
-# Disabled temporarily till leaks in client_test are fixed.
-#
-#TESTS_ENVIRONMENT = VALGRIND=$(VALGRIND) srcdir=$(srcdir) ./run_test
-TESTS_ENVIRONMENT = VALGRIND=$(VALGRIND) srcdir=$(srcdir)
+TESTS_ENVIRONMENT = VALGRIND=$(VALGRIND) srcdir=$(srcdir) ./run_test
system_tests = client_test quick_topictest
TESTS = dummy_test $(unit_progs) $(unit_wrappers) run-unit-tests start_broker $(system_tests) python_tests kill_broker daemon_test
diff --git a/cpp/src/tests/cluster.mk b/cpp/src/tests/cluster.mk
index fd8f789363..bf777c6255 100644
--- a/cpp/src/tests/cluster.mk
+++ b/cpp/src/tests/cluster.mk
@@ -6,16 +6,20 @@ lib_cluster = $(abs_builddir)/../libqpidcluster.la
# NOTE: Programs using the openais library must be run with gid=ais
# Such programs are built as *.ais, with a wrapper script *.sh that
-# runs the program under sudo -u ais.
+# runs the program with newgrp ais.
#
-# Rule to generate wrappers.
-# The chmod is a horrible hack to allow libtools annoying wrapers to
-# relink the executable when run as user ais.
+# Rule to generate wrapper scripts for tests that require gid=ais.
+run_test="env VALGRIND=$(VALGRIND) srcdir=$(srcdir) $(srcdir)/run_test"
.ais.sh:
- echo sudo -u ais env VALGRIND=$(VALGRIND) srcdir=$(srcdir) $(srcdir)/run_test ./$< >$@; chmod a+x $@
- chmod a+rwx . .libs
+ echo "if groups | grep '\bais\b' >/dev/null;" > $@_t
+ echo "then echo $(run_test) ./$< \"$$@ \"| newgrp ais;" >>$@_t
+ echo "else echo WARNING: `whoami` not in group ais, skipping $<.;" >>$@_t
+ echo "fi" >> $@_t
+ mv $@_t $@
+ chmod a+x $@
+#
# Cluster tests.
#
check_PROGRAMS+=Cpg.ais