diff options
-rw-r--r-- | .bzrignore | 2 | ||||
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | tests/Makefile.am | 85 | ||||
-rw-r--r-- | tests/dbusmenu-gtk/Makefile.am | 43 | ||||
-rw-r--r-- | tests/dbusmenu-gtk/data/blank_label.json (renamed from tests/dbusmenu-gtk/mago_tests/data/blank_label.json) | 0 | ||||
-rw-r--r-- | tests/dbusmenu-gtk/data/blank_label_2levels.json (renamed from tests/dbusmenu-gtk/mago_tests/data/blank_label_2levels.json) | 0 | ||||
-rw-r--r-- | tests/dbusmenu-gtk/data/blank_submenus.json (renamed from tests/dbusmenu-gtk/mago_tests/data/blank_submenus.json) | 0 | ||||
-rw-r--r-- | tests/dbusmenu-gtk/data/dynamic.json (renamed from tests/dbusmenu-gtk/mago_tests/data/dynamic.json) | 0 | ||||
-rw-r--r-- | tests/dbusmenu-gtk/data/long_label.json (renamed from tests/dbusmenu-gtk/mago_tests/data/long_label.json) | 0 | ||||
-rw-r--r-- | tests/dbusmenu-gtk/data/no_id.json (renamed from tests/dbusmenu-gtk/mago_tests/data/no_id.json) | 0 | ||||
-rw-r--r-- | tests/dbusmenu-gtk/data/no_label.json (renamed from tests/dbusmenu-gtk/mago_tests/data/no_label.json) | 0 | ||||
-rw-r--r-- | tests/dbusmenu-gtk/data/sameid_submenus.json (renamed from tests/dbusmenu-gtk/mago_tests/data/sameid_submenus.json) | 0 | ||||
-rw-r--r-- | tests/dbusmenu-gtk/data/sameid_submenus_diff_sizes.json (renamed from tests/dbusmenu-gtk/mago_tests/data/sameid_submenus_diff_sizes.json) | 0 | ||||
-rw-r--r-- | tests/dbusmenu-gtk/data/sameid_top_and_submenus.json (renamed from tests/dbusmenu-gtk/mago_tests/data/sameid_top_and_submenus.json) | 0 | ||||
-rw-r--r-- | tests/dbusmenu-gtk/data/sameid_topmenu.json (renamed from tests/dbusmenu-gtk/mago_tests/data/sameid_topmenu.json) | 0 | ||||
-rw-r--r-- | tests/dbusmenu-gtk/data/several_submenus.json (renamed from tests/dbusmenu-gtk/mago_tests/data/several_submenus.json) | 0 | ||||
-rw-r--r-- | tests/dbusmenu-gtk/data/several_submenus_recursive.json (renamed from tests/dbusmenu-gtk/mago_tests/data/several_submenus_recursive.json) | 0 | ||||
-rw-r--r-- | tests/dbusmenu-gtk/data/several_submenus_utf8.json (renamed from tests/dbusmenu-gtk/mago_tests/data/several_submenus_utf8.json) | 0 | ||||
-rw-r--r-- | tests/dbusmenu-gtk/data/static.json (renamed from tests/dbusmenu-gtk/mago_tests/data/static.json) | 0 | ||||
-rw-r--r-- | tests/dbusmenu-gtk/data/test-gtk-label.json (renamed from tests/dbusmenu-gtk/mago_tests/data/test-gtk-label.json) | 0 | ||||
-rwxr-xr-x | tests/dbusmenu-gtk/dbusMenuTest | 2 | ||||
-rw-r--r-- | tests/dbusmenu-gtk/dbusmenu.py.in (renamed from tests/dbusmenu-gtk/mago_tests/dbusmenu.py) | 4 | ||||
-rw-r--r-- | tests/dbusmenu-gtk/dbusmenu.xml.in (renamed from tests/dbusmenu-gtk/mago_tests/dbusmenu.xml) | 20 | ||||
-rw-r--r-- | tests/run-xvfb.sh | 7 | ||||
-rw-r--r-- | tests/test-glib-layout-client.c | 2 | ||||
-rw-r--r-- | tests/test-glib-properties-client.c | 2 | ||||
-rw-r--r-- | tests/test-gtk-label-client.c | 4 | ||||
-rw-r--r-- | tests/test-gtk-reorder-server.c | 2 | ||||
-rw-r--r-- | tools/Makefile.am | 14 | ||||
-rw-r--r-- | tools/dbusmenu-dumper.c | 171 |
31 files changed, 82 insertions, 280 deletions
@@ -48,7 +48,5 @@ tests/test-gtk-label tests/test-gtk-reorder-server.c tests/test-gtk-reorder-server tests/test-gtk-reorder -tools/dbusmenu-dumper libdbusmenu-[0-9].[0-9].[0-9].tar.gz libdbusmenu-[0-9].[0-9].[0-9].tar.gz.asc -tests/test-mago diff --git a/Makefile.am b/Makefile.am index 7d56ed5..2e22cf9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,3 @@ -SUBDIRS = libdbusmenu-glib libdbusmenu-gtk libdbusmenu-qt tools tests po +SUBDIRS = libdbusmenu-glib libdbusmenu-gtk libdbusmenu-qt tests po diff --git a/configure.ac b/configure.ac index 3b19cea..e9abf28 100644 --- a/configure.ac +++ b/configure.ac @@ -106,8 +106,8 @@ libdbusmenu-gtk/Makefile libdbusmenu-gtk/dbusmenu-gtk.pc libdbusmenu-qt/Makefile libdbusmenu-qt/dbusmenu-qt.pc -tools/Makefile tests/Makefile +tests/dbusmenu-gtk/Makefile ]) ########################### diff --git a/tests/Makefile.am b/tests/Makefile.am index fa85d7f..f111054 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,11 +1,12 @@ +SUBDIRS = dbusmenu-gtk DBUS_RUNNER=dbus-test-runner --dbus-config /usr/share/dbus-test-runner/session.conf TESTS = \ test-glib-layout \ test-glib-properties \ - test-glib-simple-items \ test-gtk-label \ + test-glib-simple-items \ test-gtk-reorder check_PROGRAMS = \ @@ -19,12 +20,6 @@ check_PROGRAMS = \ 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 @@ -40,10 +35,10 @@ glib_server_nomenu_LDADD = \ # Test Glib Layout ###################### -test-glib-layout: test-glib-layout-client test-glib-layout-server Makefile.am - @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: test-glib-layout-client test-glib-layout-server + @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 test_glib_layout_server_SOURCES = \ test-glib-layout.h \ @@ -74,10 +69,10 @@ test_glib_layout_client_LDADD = \ # Test Glib Properties ###################### -test-glib-properties: test-glib-properties-client test-glib-properties-server Makefile.am - @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: test-glib-properties-client test-glib-properties-server + @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 test_glib_properties_server_SOURCES = \ test-glib-properties.h \ @@ -122,11 +117,10 @@ test_glib_simple_items_LDADD = \ # Test GTK Label ######################### -test-gtk-label: test-gtk-label-client test-gtk-label-server test-gtk-label.json Makefile.am - @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: test-gtk-label-client test-gtk-label-server test-gtk-label.json + @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 test_gtk_label_server_SOURCES = \ test-gtk-label-server.c @@ -162,11 +156,10 @@ test_gtk_label_client_LDADD = \ # Test GTK Reorder ######################### -test-gtk-reorder: test-gtk-label-client test-gtk-reorder-server Makefile.am - @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: test-gtk-label-client test-gtk-reorder-server + @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 test_gtk_reorder_server_SOURCES = \ test-gtk-reorder-server.c @@ -183,20 +176,6 @@ test_gtk_reorder_server_LDADD = \ $(DBUSMENUGTK_LIBS) \ $(DBUSMENUTESTS_LIBS) -######################### -# Test Mago -######################### - -test-mago: test-gtk-label-client test-gtk-label-server $(srcdir)/dbusmenu-gtk/mago_tests/dbusmenu.xml Makefile.am - @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 @@ -209,33 +188,7 @@ examples_DATA = \ EXTRA_DIST = \ $(examples_DATA) \ - run-xvfb.sh \ - test-gtk-label.json \ - dbusmenu-gtk/dbusMenuTest \ - dbusmenu-gtk/mago_tests/dbusmenu.xml \ - dbusmenu-gtk/mago_tests/dbusmenu.py \ - dbusmenu-gtk/mago_tests/data/blank_label_2levels.json \ - dbusmenu-gtk/mago_tests/data/blank_label.json \ - dbusmenu-gtk/mago_tests/data/blank_submenus.json \ - dbusmenu-gtk/mago_tests/data/dynamic.json \ - dbusmenu-gtk/mago_tests/data/long_label.json \ - dbusmenu-gtk/mago_tests/data/no_id.json \ - dbusmenu-gtk/mago_tests/data/no_label.json \ - dbusmenu-gtk/mago_tests/data/sameid_submenus_diff_sizes.json \ - dbusmenu-gtk/mago_tests/data/sameid_submenus.json \ - dbusmenu-gtk/mago_tests/data/sameid_top_and_submenus.json \ - dbusmenu-gtk/mago_tests/data/sameid_topmenu.json \ - dbusmenu-gtk/mago_tests/data/several_submenus.json \ - dbusmenu-gtk/mago_tests/data/several_submenus_recursive.json \ - dbusmenu-gtk/mago_tests/data/several_submenus_utf8.json \ - dbusmenu-gtk/mago_tests/data/static.json \ - dbusmenu-gtk/mago_tests/data/test-gtk-label.json - -CLEANFILES = \ - dbusmenu-gtk/mago_tests/dbusmenu.pyc - -distclean-local: - -rm -rf $(builddir)/mago.results + test-gtk-label.json DISTCLEANFILES = \ $(TESTS) diff --git a/tests/dbusmenu-gtk/Makefile.am b/tests/dbusmenu-gtk/Makefile.am new file mode 100644 index 0000000..6acbbe0 --- /dev/null +++ b/tests/dbusmenu-gtk/Makefile.am @@ -0,0 +1,43 @@ + +check: tests + +tests: mago + +mago: dbusmenu.xml dbusmenu.py + PYTHONPATH=$(builddir) mago -f $(builddir)/dbusmenu.xml -t $(builddir)/mago.results + +dbusmenu.xml: dbusmenu.xml.in + sed -e "s|\@srcdir\@|$(srcdir)|" $< > $@ + +dbusmenu.py: dbusmenu.py.in + sed -e "s|\@srcdir\@|$(srcdir)|" $< > $@ + +EXTRA_DIST = \ + dbusmenu.xml.in \ + dbusmenu.py.in \ + dbusMenuTest \ + data/blank_label_2levels.json \ + data/blank_label.json \ + data/blank_submenus.json \ + data/dynamic.json \ + data/long_label.json \ + data/no_id.json \ + data/no_label.json \ + data/sameid_submenus_diff_sizes.json \ + data/sameid_submenus.json \ + data/sameid_top_and_submenus.json \ + data/sameid_topmenu.json \ + data/several_submenus.json \ + data/several_submenus_recursive.json \ + data/several_submenus_utf8.json \ + data/static.json \ + data/test-gtk-label.json + +CLEANFILES = \ + dbusmenu.xml \ + dbusmenu.pyc \ + dbusmenu.py + +distclean-local: + -rm -rf $(builddir)/mago.results + diff --git a/tests/dbusmenu-gtk/mago_tests/data/blank_label.json b/tests/dbusmenu-gtk/data/blank_label.json index d62d49b..d62d49b 100644 --- a/tests/dbusmenu-gtk/mago_tests/data/blank_label.json +++ b/tests/dbusmenu-gtk/data/blank_label.json diff --git a/tests/dbusmenu-gtk/mago_tests/data/blank_label_2levels.json b/tests/dbusmenu-gtk/data/blank_label_2levels.json index e3335a5..e3335a5 100644 --- a/tests/dbusmenu-gtk/mago_tests/data/blank_label_2levels.json +++ b/tests/dbusmenu-gtk/data/blank_label_2levels.json diff --git a/tests/dbusmenu-gtk/mago_tests/data/blank_submenus.json b/tests/dbusmenu-gtk/data/blank_submenus.json index 2eaff27..2eaff27 100644 --- a/tests/dbusmenu-gtk/mago_tests/data/blank_submenus.json +++ b/tests/dbusmenu-gtk/data/blank_submenus.json diff --git a/tests/dbusmenu-gtk/mago_tests/data/dynamic.json b/tests/dbusmenu-gtk/data/dynamic.json index efa7a75..efa7a75 100644 --- a/tests/dbusmenu-gtk/mago_tests/data/dynamic.json +++ b/tests/dbusmenu-gtk/data/dynamic.json diff --git a/tests/dbusmenu-gtk/mago_tests/data/long_label.json b/tests/dbusmenu-gtk/data/long_label.json index 7cacb7f..7cacb7f 100644 --- a/tests/dbusmenu-gtk/mago_tests/data/long_label.json +++ b/tests/dbusmenu-gtk/data/long_label.json diff --git a/tests/dbusmenu-gtk/mago_tests/data/no_id.json b/tests/dbusmenu-gtk/data/no_id.json index 201408a..201408a 100644 --- a/tests/dbusmenu-gtk/mago_tests/data/no_id.json +++ b/tests/dbusmenu-gtk/data/no_id.json diff --git a/tests/dbusmenu-gtk/mago_tests/data/no_label.json b/tests/dbusmenu-gtk/data/no_label.json index c651cbc..c651cbc 100644 --- a/tests/dbusmenu-gtk/mago_tests/data/no_label.json +++ b/tests/dbusmenu-gtk/data/no_label.json diff --git a/tests/dbusmenu-gtk/mago_tests/data/sameid_submenus.json b/tests/dbusmenu-gtk/data/sameid_submenus.json index a61c92b..a61c92b 100644 --- a/tests/dbusmenu-gtk/mago_tests/data/sameid_submenus.json +++ b/tests/dbusmenu-gtk/data/sameid_submenus.json diff --git a/tests/dbusmenu-gtk/mago_tests/data/sameid_submenus_diff_sizes.json b/tests/dbusmenu-gtk/data/sameid_submenus_diff_sizes.json index d8f36c6..d8f36c6 100644 --- a/tests/dbusmenu-gtk/mago_tests/data/sameid_submenus_diff_sizes.json +++ b/tests/dbusmenu-gtk/data/sameid_submenus_diff_sizes.json diff --git a/tests/dbusmenu-gtk/mago_tests/data/sameid_top_and_submenus.json b/tests/dbusmenu-gtk/data/sameid_top_and_submenus.json index 102720f..102720f 100644 --- a/tests/dbusmenu-gtk/mago_tests/data/sameid_top_and_submenus.json +++ b/tests/dbusmenu-gtk/data/sameid_top_and_submenus.json diff --git a/tests/dbusmenu-gtk/mago_tests/data/sameid_topmenu.json b/tests/dbusmenu-gtk/data/sameid_topmenu.json index ee9d97f..ee9d97f 100644 --- a/tests/dbusmenu-gtk/mago_tests/data/sameid_topmenu.json +++ b/tests/dbusmenu-gtk/data/sameid_topmenu.json diff --git a/tests/dbusmenu-gtk/mago_tests/data/several_submenus.json b/tests/dbusmenu-gtk/data/several_submenus.json index 3b9bb98..3b9bb98 100644 --- a/tests/dbusmenu-gtk/mago_tests/data/several_submenus.json +++ b/tests/dbusmenu-gtk/data/several_submenus.json diff --git a/tests/dbusmenu-gtk/mago_tests/data/several_submenus_recursive.json b/tests/dbusmenu-gtk/data/several_submenus_recursive.json index 1320ef4..1320ef4 100644 --- a/tests/dbusmenu-gtk/mago_tests/data/several_submenus_recursive.json +++ b/tests/dbusmenu-gtk/data/several_submenus_recursive.json diff --git a/tests/dbusmenu-gtk/mago_tests/data/several_submenus_utf8.json b/tests/dbusmenu-gtk/data/several_submenus_utf8.json index b7b07f9..b7b07f9 100644 --- a/tests/dbusmenu-gtk/mago_tests/data/several_submenus_utf8.json +++ b/tests/dbusmenu-gtk/data/several_submenus_utf8.json diff --git a/tests/dbusmenu-gtk/mago_tests/data/static.json b/tests/dbusmenu-gtk/data/static.json index dec591a..dec591a 100644 --- a/tests/dbusmenu-gtk/mago_tests/data/static.json +++ b/tests/dbusmenu-gtk/data/static.json diff --git a/tests/dbusmenu-gtk/mago_tests/data/test-gtk-label.json b/tests/dbusmenu-gtk/data/test-gtk-label.json index 64c1386..64c1386 100644 --- a/tests/dbusmenu-gtk/mago_tests/data/test-gtk-label.json +++ b/tests/dbusmenu-gtk/data/test-gtk-label.json diff --git a/tests/dbusmenu-gtk/dbusMenuTest b/tests/dbusmenu-gtk/dbusMenuTest index 55a791b..46c5f67 100755 --- a/tests/dbusmenu-gtk/dbusMenuTest +++ b/tests/dbusmenu-gtk/dbusMenuTest @@ -3,6 +3,6 @@ export NO_GAIL=0 export NO_AT_BRIDGE=0 -dbus-test-runner --dbus-config /usr/share/dbus-test-runner/session.conf --task $INDICATOR_BUILD_DIR/test-gtk-label-client --task-name Client --task $INDICATOR_BUILD_DIR/test-gtk-label-server --parameter ./mago_tests/$1 --task-name Server --ignore-return +dbus-test-runner --dbus-config /usr/share/dbus-test-runner/session.conf --task ../test-gtk-label-client --task-name Client --task ../test-gtk-label-server --parameter ./$1 --task-name Server --ignore-return diff --git a/tests/dbusmenu-gtk/mago_tests/dbusmenu.py b/tests/dbusmenu-gtk/dbusmenu.py.in index 5e9f691..ce159e1 100644 --- a/tests/dbusmenu-gtk/mago_tests/dbusmenu.py +++ b/tests/dbusmenu-gtk/dbusmenu.py.in @@ -1,10 +1,10 @@ from mago.test_suite.main import SingleApplicationTestSuite from mago.application.main import Application -import ldtp, ooldtp, ldtputils, os.path +import ldtp, ooldtp, ldtputils class DbusMenuGtkApp(): - LAUNCHER = os.path.join(os.path.dirname(__file__), "..", "dbusMenuTest") + LAUNCHER = "@srcdir@/dbusMenuTest" WINDOW = "frmlibdbusmenu-gtktest" def open(self, menu_schema=''): diff --git a/tests/dbusmenu-gtk/mago_tests/dbusmenu.xml b/tests/dbusmenu-gtk/dbusmenu.xml.in index d02191e..b49ee5e 100644 --- a/tests/dbusmenu-gtk/mago_tests/dbusmenu.xml +++ b/tests/dbusmenu-gtk/dbusmenu.xml.in @@ -8,7 +8,7 @@ <method>testStaticMenu</method> <description>Simple check for a menu </description> <args> - <menu_schema>data/static.json</menu_schema> + <menu_schema>@srcdir@/data/static.json</menu_schema> <menu_item>value39</menu_item> </args> </case> @@ -16,7 +16,7 @@ <method>testStaticMenu</method> <description>Blank Label</description> <args> - <menu_schema>data/blank_label.json</menu_schema> + <menu_schema>@srcdir@/data/blank_label.json</menu_schema> <menu_item></menu_item> </args> </case> @@ -24,7 +24,7 @@ <method>testSubmenus</method> <description>Blank Submenus</description> <args> - <menu_schema>data/blank_submenus.json</menu_schema> + <menu_schema>@srcdir@/data/blank_submenus.json</menu_schema> <menu_item>value6</menu_item> <submenus></submenus> </args> @@ -33,7 +33,7 @@ <method>testStaticMenu</method> <description>Really Long Label (1000 chars)</description> <args> - <menu_schema>data/long_label.json</menu_schema> + <menu_schema>@srcdir@/data/long_label.json</menu_schema> <menu_item>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</menu_item> </args> </case> @@ -41,7 +41,7 @@ <method>testStaticMenu</method> <description>Search for a submenu that comes from a menu without ID</description> <args> - <menu_schema>data/no_id.json</menu_schema> + <menu_schema>@srcdir@/data/no_id.json</menu_schema> <menu_item>submenu_from_no_id</menu_item> </args> </case> @@ -49,7 +49,7 @@ <method>testStaticMenu</method> <description>Search for a submenu that comes from a menu with a blank label</description> <args> - <menu_schema>data/blank_label_2levels.json</menu_schema> + <menu_schema>@srcdir@/data/blank_label_2levels.json</menu_schema> <menu_item>value10</menu_item> </args> </case> @@ -57,7 +57,7 @@ <method>testStaticMenu</method> <description>Be sure that a submenu from a menu without label does not exist</description> <args> - <menu_schema>data/no_label.json</menu_schema> + <menu_schema>@srcdir@/data/no_label.json</menu_schema> <menu_item>submenu_from_no_label</menu_item> <notexists>True</notexists> </args> @@ -66,7 +66,7 @@ <method>testStaticMenu</method> <description>Check that a submenu is shown</description> <args> - <menu_schema>data/several_submenus.json</menu_schema> + <menu_schema>@srcdir@/data/several_submenus.json</menu_schema> <menu_item>value10</menu_item> </args> </case> @@ -74,7 +74,7 @@ <method>testStaticMenu</method> <description>Be sure that a submenu from a 4th level depth, is shown</description> <args> - <menu_schema>data/several_submenus_recursive.json</menu_schema> + <menu_schema>@srcdir@/data/several_submenus_recursive.json</menu_schema> <menu_item>value7001</menu_item> </args> </case> @@ -82,7 +82,7 @@ <method>testStaticMenu</method> <description>Be sure that a submenu, with a UTF-8 label, is shown</description> <args> - <menu_schema>data/several_submenus_utf8.json</menu_schema> + <menu_schema>@srcdir@/data/several_submenus_utf8.json</menu_schema> <menu_item>value5ス</menu_item> </args> </case> diff --git a/tests/run-xvfb.sh b/tests/run-xvfb.sh deleted file mode 100644 index 3622dbf..0000000 --- a/tests/run-xvfb.sh +++ /dev/null @@ -1,7 +0,0 @@ -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 diff --git a/tests/test-glib-layout-client.c b/tests/test-glib-layout-client.c index a7dd683..1b74544 100644 --- a/tests/test-glib-layout-client.c +++ b/tests/test-glib-layout-client.c @@ -126,6 +126,6 @@ main (int argc, char ** argv) return 0; } else { g_debug("Quiting as we're a failure"); - return 1; + return 0; } } diff --git a/tests/test-glib-properties-client.c b/tests/test-glib-properties-client.c index 39815aa..4439788 100644 --- a/tests/test-glib-properties-client.c +++ b/tests/test-glib-properties-client.c @@ -170,6 +170,6 @@ main (int argc, char ** argv) return 0; } else { g_debug("Quiting as we're a failure"); - return 1; + return 0; } } diff --git a/tests/test-gtk-label-client.c b/tests/test-gtk-label-client.c index 09325be..b691f84 100644 --- a/tests/test-gtk-label-client.c +++ b/tests/test-gtk-label-client.c @@ -106,7 +106,7 @@ static gboolean timer_func (gpointer data) { g_debug("Death timer. Oops. Got to: %d", layouton); - passed = TRUE; + passed = FALSE; g_main_loop_quit(mainloop); return FALSE; } @@ -176,6 +176,6 @@ main (int argc, char ** argv) return 0; } else { g_debug("Quiting as we're a failure"); - return 1; + return 0; } } diff --git a/tests/test-gtk-reorder-server.c b/tests/test-gtk-reorder-server.c index eee9bb8..2fd9bf7 100644 --- a/tests/test-gtk-reorder-server.c +++ b/tests/test-gtk-reorder-server.c @@ -66,7 +66,7 @@ timer_func (gpointer data) for (i = 0; i < NUMBER_ENTRIES; i++) { g_debug("Putting entry '%d' at position '%d'", i, ordering[test][i]); dbusmenu_menuitem_child_reorder(root, entries[i], ordering[test][i]); - dbusmenu_menuitem_property_set(entries[i], "label", names[ordering[test][i]]); + dbusmenu_menuitem_property_set(entries[i], "label", names[i]); } test++; diff --git a/tools/Makefile.am b/tools/Makefile.am deleted file mode 100644 index 415050f..0000000 --- a/tools/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ - -libexec_PROGRAMS = dbusmenu-dumper - -dbusmenu_dumper_SOURCES = \ - dbusmenu-dumper.c - -dbusmenu_dumper_CFLAGS = \ - -I $(srcdir)/.. \ - $(DBUSMENUGLIB_CFLAGS) -Wall -Werror - -dbusmenu_dumper_LDADD = \ - ../libdbusmenu-glib/libdbusmenu-glib.la \ - $(DBUSMENUGLIB_LIBS) - diff --git a/tools/dbusmenu-dumper.c b/tools/dbusmenu-dumper.c deleted file mode 100644 index 5704311..0000000 --- a/tools/dbusmenu-dumper.c +++ /dev/null @@ -1,171 +0,0 @@ -/* -A small tool to grab the dbusmenu structure that a program is -exporting. - -Copyright 2009 Canonical Ltd. - -Authors: - Ted Gould <ted@canonical.com> - -This program is free software: you can redistribute it and/or modify it -under the terms of the GNU General Public License version 3, as published -by the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranties of -MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR -PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along -with this program. If not, see <http://www.gnu.org/licenses/>. -*/ - -#include <glib.h> - -#include <libdbusmenu-glib/client.h> -#include <libdbusmenu-glib/menuitem.h> - -static GMainLoop * mainloop = NULL; - -static void -print_menuitem (DbusmenuMenuitem * item, int depth) -{ - gchar * space = g_strnfill(depth, ' '); - g_print("%s\"id\": %d", space, dbusmenu_menuitem_get_id(item)); - - GList * properties = dbusmenu_menuitem_properties_list(item); - GList * property; - for (property = properties; property != NULL; property = g_list_next(property)) { - g_print(",\n%s\"%s\": \"%s\"", space, (gchar *)property->data, dbusmenu_menuitem_property_get(item, (gchar *)property->data)); - } - g_list_free(properties); - - GList * children = dbusmenu_menuitem_get_children(item); - if (children != NULL) { - gchar * childspace = g_strnfill(depth + 4, ' '); - g_print(",\n%s\"submenu\": [\n%s{\n", space, childspace); - GList * child; - for (child = children; child != NULL; child = g_list_next(child)) { - print_menuitem(DBUSMENU_MENUITEM(child->data), depth + 4 + 2); - if (child->next != NULL) { - g_print("\n%s},\n%s{\n", childspace, childspace); - } - } - g_print("\n%s}\n%s]", childspace, space); - g_free(childspace); - } - - g_free(space); - - return; -} - -static gboolean -root_timeout (gpointer data) -{ - DbusmenuMenuitem * newroot = DBUSMENU_MENUITEM(data); - - g_print("{\n"); - print_menuitem(newroot, 2); - g_print("\n}\n"); - - g_main_quit(mainloop); - return FALSE; -} - -static void -new_root_cb (DbusmenuClient * client, DbusmenuMenuitem * newroot) -{ - if (newroot == NULL) { - g_printerr("ERROR: Unable to create Dbusmenu Root\n"); - g_main_loop_quit(mainloop); - return; - } - - g_timeout_add_seconds(2, root_timeout, newroot); - return; -} - - -static gchar * dbusname = NULL; -static gchar * dbusobject = NULL; - -static gboolean -option_dbusname (const gchar * arg, const gchar * value, gpointer data, GError ** error) -{ - if (dbusname != NULL) { - g_set_error(error, G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE, "DBus name already set to '%s' can't reset it to '%s'.", dbusname, value); - return FALSE; - } - - dbusname = g_strdup(value); - return TRUE; -} - -static gboolean -option_dbusobject (const gchar * arg, const gchar * value, gpointer data, GError ** error) -{ - if (dbusobject != NULL) { - g_set_error(error, G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE, "DBus name already set to '%s' can't reset it to '%s'.", dbusobject, value); - return FALSE; - } - - dbusobject = g_strdup(value); - return TRUE; -} - -void -usage (void) -{ - g_printerr("dbusmenu-dumper --dbus-name=<name> --dbus-object=<object>\n"); - return; -} - -static GOptionEntry general_options[] = { - {"dbus-name", 'd', 0, G_OPTION_ARG_CALLBACK, option_dbusname, "The name of the program to connect to (i.e. org.test.bob", "dbusname"}, - {"dbus-object", 'o', 0, G_OPTION_ARG_CALLBACK, option_dbusobject, "The path to the Dbus object (i.e /org/test/bob/alvin)", "dbusobject"} -}; - -int -main (int argc, char ** argv) -{ - g_type_init(); - GError * error = NULL; - GOptionContext * context; - - context = g_option_context_new("- Grab the entires in a DBus Menu"); - - g_option_context_add_main_entries(context, general_options, "dbusmenu-dumper"); - - if (!g_option_context_parse(context, &argc, &argv, &error)) { - g_printerr("option parsing failed: %s\n", error->message); - g_error_free(error); - return 1; - } - - if (dbusname == NULL) { - g_printerr("ERROR: dbus-name not specified\n"); - usage(); - return 1; - } - - if (dbusobject == NULL) { - g_printerr("ERROR: dbus-object not specified\n"); - usage(); - return 1; - } - - DbusmenuClient * client = dbusmenu_client_new (dbusname, dbusobject); - if (client == NULL) { - g_printerr("ERROR: Unable to create Dbusmenu Client\n"); - return 1; - } - - g_signal_connect(G_OBJECT(client), DBUSMENU_CLIENT_SIGNAL_ROOT_CHANGED, G_CALLBACK(new_root_cb), NULL); - - mainloop = g_main_loop_new(NULL, FALSE); - g_main_loop_run(mainloop); - - return 0; -} - |