summaryrefslogtreecommitdiffstats
path: root/gettext-tools/tests/lang-bash
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2005-02-15 14:48:11 +0000
committerBruno Haible <bruno@clisp.org>2009-06-23 12:12:16 +0200
commit5757f7f4d8493dfa34ece58e6bb3ae41f4e48224 (patch)
treeafcf361da8b10d937cc1810260f4f3d9cd6ee799 /gettext-tools/tests/lang-bash
parent8225187c2ae081bff8b081fe4cccb21b2fc1fc5d (diff)
downloadexternal_gettext-5757f7f4d8493dfa34ece58e6bb3ae41f4e48224.zip
external_gettext-5757f7f4d8493dfa34ece58e6bb3ae41f4e48224.tar.gz
external_gettext-5757f7f4d8493dfa34ece58e6bb3ae41f4e48224.tar.bz2
Perform the lang-* tests both in a traditional locale and in a UTF-8 locale,
as far as provided by the system.
Diffstat (limited to 'gettext-tools/tests/lang-bash')
-rwxr-xr-xgettext-tools/tests/lang-bash53
1 files changed, 40 insertions, 13 deletions
diff --git a/gettext-tools/tests/lang-bash b/gettext-tools/tests/lang-bash
index 0fff7e3..f9397b0 100755
--- a/gettext-tools/tests/lang-bash
+++ b/gettext-tools/tests/lang-bash
@@ -89,16 +89,30 @@ case `bash -c 'echo $BASH_VERSION'` in
*) rm -fr $tmpfiles; exit 77;;
esac
-# Test whether the fr_FR locale is installed.
+# Test which of the fr_FR locales are installed.
: ${LOCALE_FR=fr_FR}
-LC_ALL=$LOCALE_FR ./testlocale
-case $? in
- 0) ;;
- 77) rm -fr $tmpfiles; exit 77;;
- *) exit 1;;
-esac
-
-tmpfiles="$tmpfiles prog.nok prog.ok prog.out"
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR != none; then
+ LC_ALL=$LOCALE_FR ./testlocale
+ case $? in
+ 0) ;;
+ 77) LOCALE_FR=none;;
+ *) exit 1;;
+ esac
+fi
+if test $LOCALE_FR_UTF8 != none; then
+ LC_ALL=$LOCALE_FR_UTF8 ./testlocale
+ case $? in
+ 0) ;;
+ 77) LOCALE_FR_UTF8=none;;
+ *) exit 1;;
+ esac
+fi
+if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then
+ rm -fr $tmpfiles; exit 77
+fi
+
+tmpfiles="$tmpfiles prog.nok prog.ok prog.oku prog.out"
# Expected result when bash is built without i18n support.
cat <<\EOF > prog.nok
'Your command, please?', asked the waiter.
@@ -109,12 +123,25 @@ cat <<\EOF > prog.ok
«Votre commande, s'il vous plait», dit le garçon.
2 morceaux de gateau
EOF
+cat <<\EOF > prog.oku
+«Votre commande, s'il vous plait», dit le garçon.
+2 morceaux de gateau
+EOF
: ${LOCALE_FR=fr_FR}
-LANGUAGE= LC_ALL=$LOCALE_FR bash ./prog.sh 2 > prog.out || exit 1
-: ${DIFF=diff}
-${DIFF} prog.nok prog.out > /dev/null && { rm -fr $tmpfiles; exit 77; }
-${DIFF} prog.ok prog.out || exit 1
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR != none; then
+ LANGUAGE= LC_ALL=$LOCALE_FR bash ./prog.sh 2 > prog.out || exit 1
+ : ${DIFF=diff}
+ ${DIFF} prog.nok prog.out > /dev/null && { rm -fr $tmpfiles; exit 77; }
+ ${DIFF} prog.ok prog.out || exit 1
+fi
+if test $LOCALE_FR_UTF8 != none; then
+ LANGUAGE= LC_ALL=$LOCALE_FR_UTF8 bash ./prog.sh 2 > prog.out || exit 1
+ : ${DIFF=diff}
+ ${DIFF} prog.nok prog.out > /dev/null && { rm -fr $tmpfiles; exit 77; }
+ ${DIFF} prog.oku prog.out || exit 1
+fi
rm -fr $tmpfiles