summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfujiwarat <takao.fujiwara1@gmail.com>2018-03-19 17:49:01 +0900
committerfujiwarat <takao.fujiwara1@gmail.com>2018-03-19 17:49:01 +0900
commit942dcbd4b92382db2321cdb55628c76875db7e13 (patch)
tree3e712b5023e73e17c9deee55ded332e85b845447
parent73282dffb30157bf2d3ca0301201b68e4f6cf5d3 (diff)
downloadibus-anthy-942dcbd4b92382db2321cdb55628c76875db7e13.tar.gz
tests: Fixed anthytest to work with GSettings
-rw-r--r--tests/Makefile.am28
-rw-r--r--tests/anthytest.py2
2 files changed, 26 insertions, 4 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f00eef6..277e4ba 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -2,8 +2,8 @@
#
# ibus-anthy - The Anthy engine for IBus
#
-# Copyright (c) 2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
-# Copyright (c) 2017 Red Hat, Inc.
+# Copyright (c) 2017-2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
+# Copyright (c) 2017-2018 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -24,6 +24,27 @@ check:
if test x$(FORCE_TEST) != x ; then \
ARGS="$$ARGS --force"; \
fi; \
+ ANTHY_SCHEMA_FILE=org.freedesktop.ibus.engine.anthy.gschema.xml; \
+ if test \! -f $(builddir)/../data/$$ANTHY_SCHEMA_FILE ; then \
+ echo "Not found $(builddir)/../data/$$ANTHY_SCHEMA_FILE" \
+ exit -1; \
+ fi; \
+ SCHEMA_TMPDIR=`mktemp -d`; \
+ if test $$? -ne 0 ; then \
+ echo "FAILED mktemp" \
+ exit -1; \
+ fi; \
+ cp $(builddir)/../data/$$ANTHY_SCHEMA_FILE $$SCHEMA_TMPDIR; \
+ glib-compile-schemas $$SCHEMA_TMPDIR; \
+ if test $$? -ne 0 ; then \
+ echo "FAILED glib-compile-schemas $$SCHEMA_TMPDIR" \
+ exit -1; \
+ fi; \
+ if test \! -f $$SCHEMA_TMPDIR/gschemas.compiled ; then \
+ echo "Not found $$SCHEMA_TMPDIR/gschemas.compiled" \
+ exit -1; \
+ fi; \
+ export GSETTINGS_SCHEMA_DIR=$$SCHEMA_TMPDIR ; \
ibus-daemon --daemonize --verbose; \
sleep 1; \
ps -ef | grep $$USER | grep ibus | grep -v grep; \
@@ -40,7 +61,8 @@ check:
echo "#### Starting Python2 API test"; \
env IBUS_ANTHY_ENGINE_PATH=$(srcdir)/../engine/python2 \
IBUS_ANTHY_SETUP_PATH=$(srcdir)/../setup/python2 \
- python2 $(srcdir)/anthytest.py $$ARGS;
+ python2 $(srcdir)/anthytest.py $$ARGS; \
+ rm -rf $$SCHEMA_TMPDIR; \
ibus exit
EXTRA_DIST = \
diff --git a/tests/anthytest.py b/tests/anthytest.py
index cceafce..0d28281 100644
--- a/tests/anthytest.py
+++ b/tests/anthytest.py
@@ -119,7 +119,7 @@ class AnthyTest:
self.__rerun = True
def create_window(self):
- window = Gtk.Window(Gtk.WindowType.TOPLEVEL)
+ window = Gtk.Window(type = Gtk.WindowType.TOPLEVEL)
self.__entry = entry = Gtk.Entry()
window.connect('destroy', Gtk.main_quit)
entry.connect('focus-in-event', self.__entry_focus_in_event_cb)