summaryrefslogtreecommitdiffstats
path: root/gettext-tools/tests/gettext-4
blob: 1e27179015e19037aa6d60d0a08c0202b08e70a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#! /bin/sh

# Test that bind_textdomain_codeset() works.

tmpfiles=""
trap 'rm -fr $tmpfiles' 1 2 3 15

# This test works only on systems that have a traditional french locale
# installed.
# gettext-4.po is actually a German PO file, but only the encoding of the
# locale matters, not the language. configure has already checked whether
# a traditional french locale is installed; no need to check also for a
# traditional german locale.
: ${LOCALE_FR=fr_FR}
{ test $LOCALE_FR != none && LC_ALL=$LOCALE_FR ./testlocale; } || {
  if test -f /usr/bin/localedef; then
    echo "Skipping test: no traditional french locale is installed"
  else
    echo "Skipping test: no traditional french locale is supported"
  fi
  exit 77
}

tmpfiles="$tmpfiles fr_FR"
test -d fr_FR || mkdir fr_FR
test -d fr_FR/LC_MESSAGES || mkdir fr_FR/LC_MESSAGES

: ${MSGFMT=msgfmt}
${MSGFMT} -o fr_FR/LC_MESSAGES/codeset.mo ${top_srcdir}/tests/gettext-4.po

./gettext-4-prg $LOCALE_FR || exit 1

rm -fr $tmpfiles

exit 0