[Telepathy-commits] [telepathy-gabble/master] tests/twisted: after tests, sleep long enough for Gabble to exit cleanly

Simon McVittie simon.mcvittie at collabora.co.uk
Fri Jan 16 02:49:47 PST 2009


If libdbus calls _exit() as a result of being disconnected from the session
bus, Gabble won't write out coverage data. Libraries exiting
considered harmful, etc.

This doesn't slow tests down very much in practice, since we only invoke
with-session-bus.sh once for the entire twisted directory.

(This change requires copying in a newer with-session-bus.sh from
telepathy-glib)
---
 tests/twisted/Makefile.am               |    5 ++++-
 tests/twisted/tools/with-session-bus.sh |   10 ++++++++++
 2 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/tests/twisted/Makefile.am b/tests/twisted/Makefile.am
index 92ca997..2f6375e 100644
--- a/tests/twisted/Makefile.am
+++ b/tests/twisted/Makefile.am
@@ -102,7 +102,10 @@ check-twisted:
 	$(MAKE) -C tools
 	rm -f tools/core
 	rm -f tools/gabble-testing.log
-	sh $(srcdir)/tools/with-session-bus.sh --config-file=tools/tmp-session-bus.conf -- $(MAKE) check-TESTS \
+	sh $(srcdir)/tools/with-session-bus.sh \
+		--sleep=6 \
+		--config-file=tools/tmp-session-bus.conf \
+		-- $(MAKE) check-TESTS \
 		TESTS="$(TWISTED_TESTS)" \
 		TESTS_ENVIRONMENT="$(TESTS_ENVIRONMENT) $(TEST_PYTHON)"
 	@if test -e tools/core; then\
diff --git a/tests/twisted/tools/with-session-bus.sh b/tests/twisted/tools/with-session-bus.sh
index 519b9b1..9e3ecbe 100644
--- a/tests/twisted/tools/with-session-bus.sh
+++ b/tests/twisted/tools/with-session-bus.sh
@@ -15,6 +15,7 @@ set -e
 me=with-session-bus
 
 dbus_daemon_args="--print-address=5 --print-pid=6 --fork"
+sleep=0
 
 usage ()
 {
@@ -29,6 +30,11 @@ usage ()
 
 while test "z$1" != "z--"; do
   case "$1" in
+  --sleep=*)
+    sleep="$1"
+    sleep="${sleep#--sleep=}"
+    shift
+    ;;
   --session)
     dbus_daemon_args="$dbus_daemon_args --session"
     shift
@@ -78,6 +84,10 @@ fi
 
 "$@" || e=$?
 
+if test $sleep != 0; then
+  sleep $sleep
+fi
+
 trap - INT HUP TERM
 cleanup
 
-- 
1.5.6.5




More information about the Telepathy-commits mailing list