Imported Upstream version 0.18.1.1
[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 fr"
25 test -d fr || mkdir fr
26 test -d fr/LC_MESSAGES || mkdir fr/LC_MESSAGES
27
28 : ${MSGFMT=msgfmt}
29 ${MSGFMT} -o fr/LC_MESSAGES/codeset.mo ${top_srcdir}/tests/gettext-4.po
30
31 ./gettext-4-prg $LOCALE_FR || exit 1
32
33 rm -fr $tmpfiles
34
35 exit 0