You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2007/07/19 19:09:10 UTC
svn commit: r557692 - in /incubator/qpid/trunk/qpid/cpp/src/tests:
Makefile.am README kill_broker run_test start_broker stop_broker vg_check
Author: aconway
Date: Thu Jul 19 10:09:09 2007
New Revision: 557692
URL: http://svn.apache.org/viewvc?view=rev&rev=557692
Log:
* src/tests/start_broker, stop_broker: Use valgrind on broker.
* src/tests/run_test, vg_check:
- factored valgrind check out of run_test for reuse in stop_broker.
* src/tests/Makefile.am, stop_broker, README:
- kill_broker renamed stop_broker.
Added:
incubator/qpid/trunk/qpid/cpp/src/tests/stop_broker
- copied, changed from r557616, incubator/qpid/trunk/qpid/cpp/src/tests/kill_broker
incubator/qpid/trunk/qpid/cpp/src/tests/vg_check
Removed:
incubator/qpid/trunk/qpid/cpp/src/tests/kill_broker
Modified:
incubator/qpid/trunk/qpid/cpp/src/tests/Makefile.am
incubator/qpid/trunk/qpid/cpp/src/tests/README
incubator/qpid/trunk/qpid/cpp/src/tests/run_test
incubator/qpid/trunk/qpid/cpp/src/tests/start_broker
Modified: incubator/qpid/trunk/qpid/cpp/src/tests/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/Makefile.am?view=diff&rev=557692&r1=557691&r2=557692
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/tests/Makefile.am (original)
+++ incubator/qpid/trunk/qpid/cpp/src/tests/Makefile.am Thu Jul 19 10:09:09 2007
@@ -114,11 +114,11 @@
TESTS_ENVIRONMENT = VALGRIND=$(VALGRIND) srcdir=$(srcdir) $(srcdir)/run_test
system_tests = client_test exception_test quick_topictest
-TESTS += run-unit-tests start_broker $(system_tests) python_tests kill_broker
+TESTS += run-unit-tests start_broker $(system_tests) python_tests stop_broker
EXTRA_DIST += \
test_env run_test \
- run-unit-tests start_broker python_tests kill_broker \
+ run-unit-tests start_broker python_tests stop_broker \
quick_topictest \
topictest \
.valgrind.supp-default \
Modified: incubator/qpid/trunk/qpid/cpp/src/tests/README
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/README?view=diff&rev=557692&r1=557691&r2=557692
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/tests/README (original)
+++ incubator/qpid/trunk/qpid/cpp/src/tests/README Thu Jul 19 10:09:09 2007
@@ -54,7 +54,7 @@
System tests are self contained AMQP client executables or scripts.
They are listed in the TESTS make variable, which can be over-ridden.
-The ./start_broker "test" launches the broker, ./kill_broker" kills it.
+The ./start_broker "test" launches the broker, ./stop_broker" stops it.
Tests in between assume the broker is running.
./python_tests: runs ../python/run_tests. This is the main set of
Modified: incubator/qpid/trunk/qpid/cpp/src/tests/run_test
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/run_test?view=diff&rev=557692&r1=557691&r2=557692
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/tests/run_test (original)
+++ incubator/qpid/trunk/qpid/cpp/src/tests/run_test Thu Jul 19 10:09:09 2007
@@ -12,26 +12,8 @@
# examination.
#
-vg_failed() {
- cat $VG_LOG 1>&2
- echo $1 1>&2
- exit 1
-}
+source `dirname $0`/vg_check
-vg_check()
-{
- test -f $VG_LOG || vg_failed Valgrind log file $VG_LOG missing.
- # Ensure there is an ERROR SUMMARY line.
- grep -E '^==[0-9]+== ERROR SUMMARY:' $VG_LOG > /dev/null || \
- vg_failed "No valgrind ERROR SUMMARY line in $$vg_failed."
- # Ensure that the number of errors is 0.
- grep -E '^==[0-9]+== ERROR SUMMARY: [^0]' $VG_LOG > /dev/null && \
- vg_failed "Valgrind reported errors in $vg_out; see above."
- # Check for leaks.
- grep -E '^==[0-9]+== +.* lost: [^0]' $VG_LOG && \
- vg_failed "Found memory leaks (see log file, $VG_LOG); see above."
- true
-}
# Export variables from makefile.
export VALGRIND srcdir
Modified: incubator/qpid/trunk/qpid/cpp/src/tests/start_broker
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/start_broker?view=diff&rev=557692&r1=557691&r2=557692
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/tests/start_broker (original)
+++ incubator/qpid/trunk/qpid/cpp/src/tests/start_broker Thu Jul 19 10:09:09 2007
@@ -1,2 +1,3 @@
#!/bin/sh
-../qpidd --daemon --port 0 --log.output qpidd.log > qpidd.port
+test -n "$VALGRIND" && VALGRIND="$VALGRIND --log-file-exactly=qpidd.vglog --"
+exec libtool --mode=execute $VALGRIND ../qpidd --daemon --port 0 --log.output qpidd.log > qpidd.port
Copied: incubator/qpid/trunk/qpid/cpp/src/tests/stop_broker (from r557616, incubator/qpid/trunk/qpid/cpp/src/tests/kill_broker)
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/stop_broker?view=diff&rev=557692&p1=incubator/qpid/trunk/qpid/cpp/src/tests/kill_broker&r1=557616&p2=incubator/qpid/trunk/qpid/cpp/src/tests/stop_broker&r2=557692
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/tests/kill_broker (original)
+++ incubator/qpid/trunk/qpid/cpp/src/tests/stop_broker Thu Jul 19 10:09:09 2007
@@ -1,2 +1,21 @@
#!/bin/sh
-QPID_PORT=`cat qpidd.port` ../qpidd --quit && rm -f qpidd.port
+# Stop the broker, check for errors.
+#
+source `dirname $0`/vg_check
+export QPID_PORT=`cat qpidd.port`
+rm -f qpidd.port
+
+# Wait for daemon to quit
+../qpidd --quit || ERROR=$?
+while ../qpidd --check >/dev/null 2>&1; do true; done
+
+# Check qpidd.log.
+egrep 'warn|error|critical' qpidd.log && {
+ echo "Suspicious broker log entries in qpidd.log."
+ ERROR=1
+}
+
+# Check valgrind log.
+vg_check qpidd.vglog
+
+exit $ERROR
Added: incubator/qpid/trunk/qpid/cpp/src/tests/vg_check
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/vg_check?view=auto&rev=557692
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/tests/vg_check (added)
+++ incubator/qpid/trunk/qpid/cpp/src/tests/vg_check Thu Jul 19 10:09:09 2007
@@ -0,0 +1,23 @@
+# Check for valgrind errors. Sourced by test scripts.
+
+vg_failed() {
+ cat $VG_LOG 1>&2
+ echo $1 1>&2
+ exit 1
+}
+
+vg_check()
+{
+ test -z "$1" || VG_LOG=$1
+ test -f $VG_LOG || vg_failed Valgrind log file $VG_LOG missing.
+ # Ensure there is an ERROR SUMMARY line.
+ grep -E '^==[0-9]+== ERROR SUMMARY:' $VG_LOG > /dev/null || \
+ vg_failed "No valgrind ERROR SUMMARY line in $$vg_failed."
+ # Ensure that the number of errors is 0.
+ grep -E '^==[0-9]+== ERROR SUMMARY: [^0]' $VG_LOG > /dev/null && \
+ vg_failed "Valgrind reported errors in $vg_out; see above."
+ # Check for leaks.
+ grep -E '^==[0-9]+== +.* lost: [^0]' $VG_LOG && \
+ vg_failed "Found memory leaks (see log file, $VG_LOG); see above."
+ true
+}