| 1 |
#!/bin/zsh -e |
| 2 |
# vim: set sts=4 expandtab: |
| 3 |
# Copyright (C) 2026 Osamu Aoki <[email protected]> |
| 4 |
im_config_description () { |
| 5 |
XDG_SESSION_TYPE=x11 im-config -q -t read_description "$1" |
| 6 |
} |
| 7 |
|
| 8 |
HOME=. |
| 9 |
export HOME |
| 10 |
|
| 11 |
IM_CONFIG_SETMODE="+x" |
| 12 |
export IM_CONFIG_SETMODE |
| 13 |
|
| 14 |
|
| 15 |
echo "autopackage test phase 1.1" |
| 16 |
ERRORS="" |
| 17 |
if [ "$(im_config_description auto)" != "activate IM with @@@-mark in its description" ]; then |
| 18 |
im_config_description auto |
| 19 |
echo " <-- ERROR" |
| 20 |
ERRORS="*$ERRORS" |
| 21 |
fi |
| 22 |
echo "autopackage test phase 1.2" |
| 23 |
if [ "$(im_config_description ibus)" != "activate Intelligent Input Bus (IBus)" ]; then |
| 24 |
im_config_description ibus |
| 25 |
echo " <-- ERROR" |
| 26 |
ERRORS="*$ERRORS" |
| 27 |
fi |
| 28 |
echo "autopackage test phase 1.3" |
| 29 |
if [ "$(im_config_description fcitx5)" != "activate Flexible Input Method Framework v5 (fcitx5)" ]; then |
| 30 |
im_config_description fcitx5 |
| 31 |
echo " <-- ERROR" |
| 32 |
ERRORS="*$ERRORS" |
| 33 |
fi |
| 34 |
echo "autopackage test phase 1.4" |
| 35 |
if [ "$(im_config_description none)" != "do not activate any IM and use the desktop default" ]; then |
| 36 |
im_config_description none |
| 37 |
echo " <-- ERROR" |
| 38 |
ERRORS="*$ERRORS" |
| 39 |
fi |
| 40 |
echo "ERRORS='$ERRORS'" |
| 41 |
|
| 42 |
if [ -z "$ERRORS" ]; then |
| 43 |
echo "SUCCESS" |
| 44 |
exit 0 |
| 45 |
else |
| 46 |
echo "FAILURE" |
| 47 |
exit 1 |
| 48 |
fi |
| 49 |
|