From 942dcbd4b92382db2321cdb55628c76875db7e13 Mon Sep 17 00:00:00 2001 From: fujiwarat Date: Mon, 19 Mar 2018 17:49:01 +0900 Subject: tests: Fixed anthytest to work with GSettings --- tests/Makefile.am | 28 +++++++++++++++++++++++++--- tests/anthytest.py | 2 +- 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 -# Copyright (c) 2017 Red Hat, Inc. +# Copyright (c) 2017-2018 Takao Fujiwara +# 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) -- cgit v1.2.1