Update.
[glibc.git] / intl / tst-gettext2.sh
bloba17f929fe6e8193fa6cf2b2db82a189d7c3f6fc0
1 #! /bin/sh
2 # Test of gettext functions.
3 # Copyright (C) 2000 Free Software Foundation, Inc.
4 # This file is part of the GNU C Library.
6 # The GNU C Library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Library General Public License as
8 # published by the Free Software Foundation; either version 2 of the
9 # License, or (at your option) any later version.
11 # The GNU C Library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Library General Public License for more details.
16 # You should have received a copy of the GNU Library General Public
17 # License along with the GNU C Library; see the file COPYING.LIB. If
18 # not, write to the Free Software Foundation, Inc.,
19 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 common_objpfx=$1
22 objpfx=$2
24 GCONV_PATH=${common_objpfx}iconvdata
25 export GCONV_PATH
26 LOCPATH=${objpfx}domaindir
27 export LOCPATH
28 LC_ALL=C
29 export LC_ALL
31 # Generate the test data.
32 test -d ${objpfx}domaindir || mkdir ${objpfx}domaindir
33 # Create the locale directories.
34 test -d ${objpfx}domaindir/lang1 || {
35 mkdir ${objpfx}domaindir/lang1
36 for f in ADDRESS COLLATE CTYPE IDENTIFICATION MEASUREMENT MONETARY NAME NUMERIC PAPER TELEPHONE TIME; do
37 cp ${common_objpfx}localedata/de_DE.ISO-8859-1/LC_$f \
38 ${objpfx}domaindir/lang1
39 done
41 test -d ${objpfx}domaindir/lang2 || {
42 mkdir ${objpfx}domaindir/lang2
43 for f in ADDRESS COLLATE CTYPE IDENTIFICATION MEASUREMENT MONETARY NAME NUMERIC PAPER TELEPHONE TIME; do
44 cp ${common_objpfx}localedata/de_DE.ISO-8859-1/LC_$f \
45 ${objpfx}domaindir/lang2
46 done
48 test -d ${objpfx}domaindir/lang1/LC_MESSAGES || {
49 mkdir ${objpfx}domaindir/lang1/LC_MESSAGES
50 cp ${common_objpfx}localedata/de_DE.ISO-8859-1/LC_MESSAGES/SYS_LC_MESSAGES \
51 ${objpfx}domaindir/lang1/LC_MESSAGES
53 test -d ${objpfx}domaindir/lang2/LC_MESSAGES || {
54 mkdir ${objpfx}domaindir/lang2/LC_MESSAGES
55 cp ${common_objpfx}localedata/de_DE.ISO-8859-1/LC_MESSAGES/SYS_LC_MESSAGES \
56 ${objpfx}domaindir/lang2/LC_MESSAGES
59 # Populate them.
60 msgfmt -o ${objpfx}domaindir/lang1/LC_MESSAGES/tstlang.mo \
61 tstlang1.po
63 msgfmt -o ${objpfx}domaindir/lang2/LC_MESSAGES/tstlang.mo \
64 tstlang2.po
67 # Now run the test.
68 ${common_objpfx}elf/ld.so --library-path $common_objpfx \
69 ${objpfx}tst-gettext2 > ${objpfx}tst-gettext2.out ${objpfx}domaindir &&
70 cmp ${objpfx}tst-gettext2.out - <<EOF
71 String1 - Lang1: 1st string
72 String2 - Lang1: 2nd string
73 String1 - Lang2: 1st string
74 String2 - Lang2: 2nd string
75 String1 - First string for testing.
76 String2 - Another string for testing.
77 EOF
79 exit $?