← Back to team overview

ayatana-commits team mailing list archive

[Branch ~dbusmenu-team/dbusmenu/trunk] Rev 34: XVFB based testing

 

Merge authors:
  Ted Gould (ted)
Related merge proposals:
  https://code.launchpad.net/~ted/dbusmenu/xvfb/+merge/15071
  proposed by: Ted Gould (ted)
  review: Approve - Neil J. Patel (njpatel)
------------------------------------------------------------
revno: 34 [merge]
committer: Ted Gould <ted@xxxxxxxxxxxxx>
branch nick: trunk
timestamp: Fri 2009-11-20 12:55:06 -0600
message:
  XVFB based testing
added:
  tests/run-xvfb.sh
modified:
  tests/Makefile.am


--
lp:dbusmenu
https://code.launchpad.net/~dbusmenu-team/dbusmenu/trunk

Your team ayatana-commits is subscribed to branch lp:dbusmenu.
To unsubscribe from this branch go to https://code.launchpad.net/~dbusmenu-team/dbusmenu/trunk/+edit-subscription.
=== modified file 'tests/Makefile.am'
--- tests/Makefile.am	2009-10-10 19:40:47 +0000
+++ tests/Makefile.am	2009-11-20 01:20:51 +0000
@@ -2,12 +2,12 @@
 DBUS_RUNNER=dbus-test-runner --dbus-config /usr/share/dbus-test-runner/session.conf
 
 TESTS = \
-	test-mago \
 	test-glib-layout \
 	test-glib-properties \
+	test-glib-simple-items \
 	test-gtk-label \
-	test-glib-simple-items \
-	test-gtk-reorder
+	test-gtk-reorder \
+	test-mago
 
 check_PROGRAMS = \
 	glib-server-nomenu \
@@ -20,6 +20,12 @@
 	test-glib-simple-items \
 	test-gtk-reorder-server
 
+XVFB_RUN=". $(srcdir)/run-xvfb.sh"
+
+######################
+# Test GLib server
+######################
+
 glib_server_nomenu_SOURCES = \
 	glib-server-nomenu.c
 
@@ -36,9 +42,9 @@
 ######################
 
 test-glib-layout: test-glib-layout-client test-glib-layout-server Makefile.am
-	@echo "#!/bin/sh" > test-glib-layout
-	@echo $(DBUS_RUNNER) --task ./test-glib-layout-client --task-name Client --task ./test-glib-layout-server --task-name Server --ignore-return >> test-glib-layout
-	@chmod +x test-glib-layout
+	@echo "#!/bin/bash" > $@
+	@echo $(DBUS_RUNNER) --task ./test-glib-layout-client --task-name Client --task ./test-glib-layout-server --task-name Server --ignore-return >> $@
+	@chmod +x $@
 
 test_glib_layout_server_SOURCES = \
 	test-glib-layout.h \
@@ -70,9 +76,9 @@
 ######################
 
 test-glib-properties: test-glib-properties-client test-glib-properties-server Makefile.am
-	@echo "#!/bin/sh" > test-glib-properties
-	@echo $(DBUS_RUNNER) --task ./test-glib-properties-client --task-name Client --task ./test-glib-properties-server --task-name Server --ignore-return >> test-glib-properties
-	@chmod +x test-glib-properties
+	@echo "#!/bin/bash" > $@
+	@echo $(DBUS_RUNNER) --task ./test-glib-properties-client --task-name Client --task ./test-glib-properties-server --task-name Server --ignore-return >> $@
+	@chmod +x $@
 
 test_glib_properties_server_SOURCES = \
 	test-glib-properties.h \
@@ -118,9 +124,10 @@
 #########################
 
 test-gtk-label: test-gtk-label-client test-gtk-label-server test-gtk-label.json Makefile.am
-	@echo "#!/bin/sh" > test-gtk-label
-	@echo $(DBUS_RUNNER) --task ./test-gtk-label-client --task-name Client --task ./test-gtk-label-server --parameter $(srcdir)/test-gtk-label.json --task-name Server --ignore-return >> test-gtk-label
-	@chmod +x test-gtk-label
+	@echo "#!/bin/bash" > $@
+	@echo $(XVFB_RUN) >> $@
+	@echo $(DBUS_RUNNER) --task ./test-gtk-label-client --task-name Client --task ./test-gtk-label-server --parameter $(srcdir)/test-gtk-label.json --task-name Server --ignore-return >> $@
+	@chmod +x $@
 
 test_gtk_label_server_SOURCES = \
 	test-gtk-label-server.c
@@ -157,9 +164,10 @@
 #########################
 
 test-gtk-reorder: test-gtk-label-client test-gtk-reorder-server Makefile.am
-	@echo "#!/bin/sh" > test-gtk-reorder
-	@echo $(DBUS_RUNNER) --task ./test-gtk-label-client --task-name Client --task ./test-gtk-reorder-server --parameter $(srcdir)/test-gtk-label.json --task-name Server --ignore-return >> test-gtk-reorder
-	@chmod +x test-gtk-reorder
+	@echo "#!/bin/bash" > $@
+	@echo $(XVFB_RUN) >> $@
+	@echo $(DBUS_RUNNER) --task ./test-gtk-label-client --task-name Client --task ./test-gtk-reorder-server --parameter $(srcdir)/test-gtk-label.json --task-name Server --ignore-return >> $@
+	@chmod +x $@
 
 test_gtk_reorder_server_SOURCES = \
 	test-gtk-reorder-server.c
@@ -181,13 +189,15 @@
 #########################
 
 test-mago: test-gtk-label-client test-gtk-label-server $(srcdir)/dbusmenu-gtk/mago_tests/dbusmenu.xml Makefile.am
-	@echo "#!/bin/sh" > test-mago
-	@echo cd $(srcdir)/dbusmenu-gtk >> test-mago
-	@echo echo Mago Results dir: $(abs_builddir)/mago.results >> test-mago
-	@echo echo PYTHONPATH=$(abs_srcdir)/dbusmenu-gtk/mago_tests >> test-mago
-	@echo export INDICATOR_BUILD_DIR=$(abs_builddir) >> test-mago
-	@echo PYTHONPATH=$(abs_srcdir)/dbusmenu-gtk/mago_tests mago -f dbusmenu.xml -t $(abs_builddir)/mago.results --log-level=debug >> test-mago
-	@chmod +x test-mago
+	@echo "#!/bin/bash" > $@
+	@echo $(XVFB_RUN) >> $@
+	@echo cd $(srcdir)/dbusmenu-gtk >> $@
+	@echo /usr/lib/at-spi/at-spi-registryd \& >> $@
+	@echo echo Mago Results dir: $(abs_builddir)/mago.results >> $@
+	@echo echo PYTHONPATH=$(abs_srcdir)/dbusmenu-gtk/mago_tests >> $@
+	@echo export INDICATOR_BUILD_DIR=$(abs_builddir) >> $@
+	@echo PYTHONPATH=$(abs_srcdir)/dbusmenu-gtk/mago_tests mago -f dbusmenu.xml -t $(abs_builddir)/mago.results --log-level=debug >> $@
+	@chmod +x $@
 
 #########################
 # Other
@@ -200,6 +210,7 @@
 
 EXTRA_DIST = \
 	$(examples_DATA) \
+	run-xvfb.sh \
 	test-gtk-label.json \
 	dbusmenu-gtk/dbusMenuTest \
 	dbusmenu-gtk/mago_tests/dbusmenu.xml \
@@ -222,11 +233,10 @@
 	dbusmenu-gtk/mago_tests/data/test-gtk-label.json
 
 CLEANFILES = \
-	dbusmenu-gtk/mago_tests/dbusmenu.xml \
 	dbusmenu-gtk/mago_tests/dbusmenu.pyc
 
 distclean-local:
-	-rm -rf $(builddir)/dbusmenu-gtk/mago.results
+	-rm -rf $(builddir)/mago.results
 
 DISTCLEANFILES = \
 	$(TESTS)

=== added file 'tests/run-xvfb.sh'
--- tests/run-xvfb.sh	1970-01-01 00:00:00 +0000
+++ tests/run-xvfb.sh	2009-11-20 00:03:49 +0000
@@ -0,0 +1,7 @@
+if [ "$DISPLAY" == "" ]; then
+Xvfb -ac -noreset -screen 0 800x600x16 -help 2>/dev/null 1>&2
+XID=`for id in 101 102 103 104 105 106 107 197 199 211 223 227 293 307 308 309 310 311 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 4703 4721 4723 4729 4733 4751 9973 9974 9975 9976 9977 9978 9979 9980 9981 9982 9983 9984 9985 9986 9987 9988 9989 9990 9991 9992 9993 9994 9995 9996 9997 9998 9999 ; do test -e /tmp/.X$id-lock || { echo $id; exit 0; }; done; exit 1`
+{ Xvfb -ac -noreset -screen 0 800x600x16 :$XID -screen 0 800x600x16 -nolisten tcp -auth /dev/null >/dev/null 2>&1 & trap "kill -15 $! " 0 HUP INT QUIT TRAP USR1 PIPE TERM ; } || { echo "Gtk+Tests:ERROR: Failed to start Xvfb environment for X11 target tests."; exit 1; }
+DISPLAY=:$XID
+export DISPLAY
+fi