summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorfujiwarat <takao.fujiwara1@gmail.com>2019-04-17 12:15:32 +0900
committerfujiwarat <takao.fujiwara1@gmail.com>2019-04-17 12:15:32 +0900
commita787fde9af5ab2ad23bc53fbdb126714111020aa (patch)
tree6034a6ec190874f1c6b0a7e3fedfd23d8897c166 /tests
parentcaeaf0b198eae7c897ae070e0cacf25fb85c51e4 (diff)
downloadibus-anthy-a787fde9af5ab2ad23bc53fbdb126714111020aa.tar.gz
tests: Set GTK_IM_MODULE in test-console.sh
Also checks .config/anthy besides .anthy
Diffstat (limited to 'tests')
-rw-r--r--tests/anthytest.py12
-rwxr-xr-xtests/test-build.sh1
-rwxr-xr-xtests/test-console.sh21
3 files changed, 27 insertions, 7 deletions
diff --git a/tests/anthytest.py b/tests/anthytest.py
index 0d28281..0b6e588 100644
--- a/tests/anthytest.py
+++ b/tests/anthytest.py
@@ -304,11 +304,13 @@ def main():
print('Unknown argument: %s' % o, file=sys.stderr)
print_help(sys.stderr, 1)
- anthy_user_dir = get_userhome() + '/.anthy'
- if os.path.exists(anthy_user_dir) and not force_run:
- print('Please remove %s before the test' % anthy_user_dir,
- file=sys.stderr)
- sys.exit(-1)
+ for anthy_config in ['/.config/anthy', '/.anthy']:
+ anthy_user_dir = get_userhome() + anthy_config
+ anthy_last_file = anthy_user_dir + '/last-record2_default.utf8'
+ if os.path.exists(anthy_last_file) and not force_run:
+ print('Please remove %s before the test' % anthy_last_file,
+ file=sys.stderr)
+ sys.exit(-1)
EngineTest = AnthyTest()
if not EngineTest.register_ibus_engine():
sys.exit(-1)
diff --git a/tests/test-build.sh b/tests/test-build.sh
index 75060cf..91fcca0 100755
--- a/tests/test-build.sh
+++ b/tests/test-build.sh
@@ -120,6 +120,7 @@ run_test_suite()
fi;
if test x$FORCE_TEST = x ; then
rm -r $HOME/.anthy;
+ rm -r $HOME/.config/anthy;
fi;
done;
}
diff --git a/tests/test-console.sh b/tests/test-console.sh
index 3cb8ec6..374afa8 100755
--- a/tests/test-console.sh
+++ b/tests/test-console.sh
@@ -94,6 +94,17 @@ _EOF
mkdir -p $HOME/.config
touch $HOME/.config/gnome-initial-setup-done
fi
+
+ # Prevent from launching a XDG dialog
+ XDG_LOCALE_FILE="$HOME/.config/user-dirs.locale"
+ if test -f $XDG_LOCALE_FILE ; then
+ XDG_LANG_ORIG=`cat $XDG_LOCALE_FILE`
+ XDG_LANG_NEW=`echo $LANG | sed -e 's/\(.*\)\..*/\1/'`
+ if [ "$XDG_LANG_ORIG" != "$XDG_LANG_NEW" ] ; then
+ echo "Overriding XDG locale $XDG_LANG_ORIG with $XDG_LANG_NEW"
+ echo "$XDG_LANG_NEW" > $XDG_LOCALE_FILE
+ fi
+ fi
}
run_dbus_daemon()
@@ -134,16 +145,22 @@ run_desktop()
run_test_suite()
{
- rm -rf /root/.anthy;
+ rm -rf $HOME/.anthy;
+ rm -rf $HOME/.config/anthy;
cd `dirname $0`;
echo "#### Starting $PYTHON API test $RUN_ARGS";
+ export GTK_IM_MODULE=ibus
$PYTHON -u $SRCDIR/anthytest.py $RUN_ARGS;
if test $? -ne 0 ; then
exit -1;
fi;
if test x$FORCE_TEST = x ; then
- rm -r $HOME/.anthy;
+ for ANTHY_CONFIG in ".anthy" ".config/anthy" ; do
+ if test -d $HOME/$ANTHY_CONFIG ; then
+ rm -r $HOME/$ANTHY_CONFIG;
+ fi;
+ done;
fi;
}