* string/string.h (strndupa): Add cast for C++ conformance.
[glibc.git] / intl / tst-gettext.sh
blob3bd00484f9a5c167da676d8141babf0106e73f60
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
23 malloc_trace=$3
25 GCONV_PATH=${common_objpfx}iconvdata
26 export GCONV_PATH
27 LOCPATH=${common_objpfx}localedata
28 export LOCPATH
29 LC_ALL=C
30 export LC_ALL
32 # Generate the test data.
33 test -d ${objpfx}domaindir || mkdir ${objpfx}domaindir
34 test -d ${objpfx}localedir || mkdir ${objpfx}localedir
35 # Create the domain directories.
36 test -d ${objpfx}domaindir/existing-locale || mkdir ${objpfx}domaindir/existing-locale
37 test -d ${objpfx}domaindir/existing-locale/LC_MESSAGES || mkdir ${objpfx}domaindir/existing-locale/LC_MESSAGES
38 test -d ${objpfx}domaindir/existing-locale/LC_TIME || mkdir ${objpfx}domaindir/existing-locale/LC_TIME
39 # Create the locale directories.
40 test -d ${objpfx}localedir/existing-locale || {
41 mkdir ${objpfx}localedir/existing-locale
42 for f in ADDRESS COLLATE CTYPE IDENTIFICATION MEASUREMENT MONETARY NAME NUMERIC PAPER TELEPHONE TIME; do
43 cp ${common_objpfx}localedata/de_DE.ISO-8859-1/LC_$f \
44 ${objpfx}localedir/existing-locale
45 done
47 test -d ${objpfx}localedir/existing-locale/LC_MESSAGES || {
48 mkdir ${objpfx}localedir/existing-locale/LC_MESSAGES
49 cp ${common_objpfx}localedata/de_DE.ISO-8859-1/LC_MESSAGES/SYS_LC_MESSAGES \
50 ${objpfx}localedir/existing-locale/LC_MESSAGES
53 # Populate them.
54 msgfmt -o ${objpfx}domaindir/existing-locale/LC_MESSAGES/existing-domain.mo \
55 ../po/de.po
56 msgfmt -o ${objpfx}domaindir/existing-locale/LC_TIME/existing-time-domain.mo \
57 ../po/de.po
59 # Now run the test.
60 MALLOC_TRACE=$malloc_trace LOCPATH=${objpfx}localedir:$LOCPATH \
61 ${common_objpfx}elf/ld.so --library-path $common_objpfx \
62 ${objpfx}tst-gettext > ${objpfx}tst-gettext.out ${objpfx}domaindir
64 exit $?