Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / gettext-4
1 #! /bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test that bind_textdomain_codeset() works.
5
6 # This test works only on systems that have a traditional french locale
7 # installed.
8 # gettext-4.po is actually a German PO file, but only the encoding of the
9 # locale matters, not the language. configure has already checked whether
10 # a traditional french locale is installed; no need to check also for a
11 # traditional german locale.
12 : ${LOCALE_FR=fr_FR}
13 { test $LOCALE_FR != none && LC_ALL=$LOCALE_FR ../testlocale; } || {
14   if test -f /usr/bin/localedef; then
15     echo "Skipping test: no traditional french locale is installed"
16   else
17     echo "Skipping test: no traditional french locale is supported"
18   fi
19   exit 77
20 }
21
22 test -d gt-4 || mkdir gt-4
23 test -d gt-4/fr || mkdir gt-4/fr
24 test -d gt-4/fr/LC_MESSAGES || mkdir gt-4/fr/LC_MESSAGES
25
26 : ${MSGFMT=msgfmt}
27 ${MSGFMT} -o gt-4/fr/LC_MESSAGES/codeset.mo "$abs_srcdir"/gettext-4.po
28
29 ../gettext-4-prg $LOCALE_FR || exit 1
30
31 exit 0