Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / gettext-5
1 #! /bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test that on glibc systems, the gettext() results come out in the correct
5 # encoding for locales that differ only in their encoding.
6
7 # This test works only on glibc systems.
8 : ${GLIBC2=no}
9 test "$GLIBC2" = yes || {
10   echo "Skipping test: not a glibc system"
11   exit 77
12 }
13
14 # This test works only on systems that have a de_DE.ISO-8859-1 and
15 # de_DE.UTF-8 locale installed.
16 LC_ALL=de_DE.ISO-8859-1 ../testlocale || {
17   if test -f /usr/bin/localedef; then
18     echo "Skipping test: locale de_DE.ISO-8859-1 not installed"
19   else
20     echo "Skipping test: locale de_DE.ISO-8859-1 not supported"
21   fi
22   exit 77
23 }
24 LC_ALL=de_DE.UTF-8 ../testlocale || {
25   if test -f /usr/bin/localedef; then
26     echo "Skipping test: locale de_DE.UTF-8 not installed"
27   else
28     echo "Skipping test: locale de_DE.UTF-8 not supported"
29   fi
30   exit 77
31 }
32
33 test -d gt-5 || mkdir gt-5
34 test -d gt-5/de_DE || mkdir gt-5/de_DE
35 test -d gt-5/de_DE/LC_MESSAGES || mkdir gt-5/de_DE/LC_MESSAGES
36
37 : ${MSGFMT=msgfmt}
38 ${MSGFMT} -o gt-5/de_DE/LC_MESSAGES/codeset.mo "$abs_srcdir"/gettext-5.po
39
40 ../gettext-5-prg || exit 1
41
42 exit 0