aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-02-25 14:12:05 +0000
committerConor Curran <conor.curran@canonical.com>2010-02-25 14:12:05 +0000
commita7952974571bf697b218cedacacd118e2e05e97e (patch)
tree3248095a6bd9d5bed5957fe3707e331c5dde2778
parentc879c510dbef95deea70687d59c2013005bf946d (diff)
downloadayatana-indicator-sound-a7952974571bf697b218cedacacd118e2e05e97e.tar.gz
ayatana-indicator-sound-a7952974571bf697b218cedacacd118e2e05e97e.tar.bz2
ayatana-indicator-sound-a7952974571bf697b218cedacacd118e2e05e97e.zip
fixes
-rw-r--r--tests/Makefile.am36
-rw-r--r--tests/run-xvfb.sh8
-rw-r--r--tests/test-indicator-sound.c19
3 files changed, 44 insertions, 19 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 05e1bd0..dadc1e4 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -10,14 +10,46 @@ DISTCLEANFILES = $(TESTS)
#########################################
test_indicator_sound_SOURCES = \
test-indicator-sound.c
-
+
test_indicator_sound_CFLAGS = \
$(APPLET_CFLAGS) \
-Wall -Werror \
-I$(srcdir) \
- -DBUILD_DIR="\"$(builddir)\""
+ -DBUILD_DIR="\"$(INDICATORDIR)"\"
test_indicator_sound_LDADD = \
$(APPLET_LIBS) \
$(INDICATORDIR)/libsoundmenu.la
+#DBUS_RUNNER=dbus-test-runner --dbus-config /usr/share/dbus-test-runner/session.conf
+
+#test-indicator-sound-dbus: test-indicator-sound-dbus-client test-indicator-sound-dbus-server Makefile.am
+# @echo "#!/bin/sh" > test-indicator-sound-dbus
+# @echo $(DBUS_RUNNER) --task ./test-indicator-sound-dbus-client --task-name Client --task ./test-indicator-sound-dbus-server --task-name Server --ignore-return >> test-indicator-sound-dbus
+# @chmod +x test-libappindicator-dbus
+
+#TESTS += test-libappindicator-dbus
+
+XVFB_RUN=". $(srcdir)/run-xvfb.sh"
+
+EXTRA_DIST = run-xvfb.sh
+
+
+#############################
+# Test stuff
+#############################
+
+#XML_REPORT = loader-check-results.xml
+#HTML_REPORT = loader-check-results.html
+
+#loader-tester: test-loader libsoundmenu.la Makefile
+# @echo "#!/bin/bash" > loader-tester
+# @echo $(XVFB_RUN) >> $@
+# @echo gtester -k --verbose -o=$(XML_REPORT) ./test-loader >> loader-tester
+# @chmod +x loader-tester
+
+#TESTS += loader-tester
+#DISTCLEANFILES += loader-tester
+
+#DISTCLEANFILES += $(XML_REPORT) $(HTML_REPORT)
+
diff --git a/tests/run-xvfb.sh b/tests/run-xvfb.sh
new file mode 100644
index 0000000..63b6f0d
--- /dev/null
+++ b/tests/run-xvfb.sh
@@ -0,0 +1,8 @@
+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
+echo Setting display: $DISPLAY
+fi
diff --git a/tests/test-indicator-sound.c b/tests/test-indicator-sound.c
index 81fc966..0885bb5 100644
--- a/tests/test-indicator-sound.c
+++ b/tests/test-indicator-sound.c
@@ -17,35 +17,20 @@ 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 <math.h>*/
-/*#include <glib.h>*/
-/*#include <glib-object.h>*/
-/*#include <gtk/gtk.h>*/
-/*#include <gdk/gdkkeysyms.h>*/
-/*#include <libdbusmenu-gtk/menu.h>*/
-/*#include <libido/idoscalemenuitem.h>*/
-
-/*#include <dbus/dbus-glib.h>*/
-/*#include <dbus/dbus-glib-bindings.h>*/
-
-/*#include <libindicator/indicator.h>*/
-/*#include <libindicator/indicator-object.h>*/
-/*#include <libindicator/indicator-service-manager.h>*/
-
#include <string.h>
#include "../src/indicator-sound.c"
void test_libindicator_sound_init()
{
- IndicatorObject * sound_menu = indicator_object_new_from_file("/home/ronoc/canonical/repos/branches/indicator-sound/tests-indicator-sound/indicator-sound/src/.libs/libsoundmenu.so");
+ IndicatorObject * sound_menu = indicator_object_new_from_file(BUILD_DIR "/.libs/libsoundmenu.so");
g_assert(sound_menu != NULL);
g_object_unref(G_OBJECT(sound_menu));
}
void test_libindicator_determine_state()
{
- IndicatorObject * sound_menu = indicator_object_new_from_file("/home/ronoc/canonical/repos/branches/indicator-sound/tests-indicator-sound/indicator-sound/src/.libs/libsoundmenu.so");
+ IndicatorObject * sound_menu = indicator_object_new_from_file(BUILD_DIR "/.libs/libsoundmenu.so");
get_icon(sound_menu);
determine_state_from_volume(40);