xref: /netbsd-src/external/gpl2/gettext/dist/gettext-tools/tests/gettext-5 (revision 946379e7b37692fc43f68eb0d1c10daa0a7f3b6c)
1#! /bin/sh
2
3# Test that on glibc systems, the gettext() results come out in the correct
4# encoding for locales that differ only in their encoding.
5
6tmpfiles=""
7trap 'rm -fr $tmpfiles' 1 2 3 15
8
9# This test works only on glibc systems.
10grep '@GLIBC2@.*yes' ../config.status >/dev/null || {
11  echo "Skipping test: not a glibc system"
12  exit 77
13}
14
15# This test works only on systems that have a de_DE.ISO-8859-1 and
16# de_DE.UTF-8 locale installed.
17LC_ALL=de_DE.ISO-8859-1 ./testlocale || {
18  if test -f /usr/bin/localedef; then
19    echo "Skipping test: locale de_DE.ISO-8859-1 not installed"
20  else
21    echo "Skipping test: locale de_DE.ISO-8859-1 not supported"
22  fi
23  exit 77
24}
25LC_ALL=de_DE.UTF-8 ./testlocale || {
26  if test -f /usr/bin/localedef; then
27    echo "Skipping test: locale de_DE.UTF-8 not installed"
28  else
29    echo "Skipping test: locale de_DE.UTF-8 not supported"
30  fi
31  exit 77
32}
33
34tmpfiles="$tmpfiles de_DE"
35test -d de_DE || mkdir de_DE
36test -d de_DE/LC_MESSAGES || mkdir de_DE/LC_MESSAGES
37
38: ${MSGFMT=msgfmt}
39${MSGFMT} -o de_DE/LC_MESSAGES/codeset.mo ${top_srcdir}/tests/gettext-5.po
40
41./gettext-5-prg || exit 1
42
43rm -fr $tmpfiles
44
45exit 0
46