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