Cleanup compile warnings.
[glibc.git] / intl / tst-gettext.sh
blob87ebe7cf6620f276a8676619e665eefd562cdc11
1 #! /bin/sh
2 # Test of gettext functions.
3 # Copyright (C) 2000-2013 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 Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the 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 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with the GNU C Library; if not, see
18 # <http://www.gnu.org/licenses/>.
20 set -e
22 common_objpfx=$1
23 test_program_prefix=$2
24 objpfx=$3
25 malloc_trace=$4
27 LC_ALL=C
28 export LC_ALL
30 # Generate the test data.
32 # Create the locale directories.
33 mkdir -p ${objpfx}localedir/existing-locale/LC_MESSAGES
34 for f in ADDRESS COLLATE CTYPE IDENTIFICATION MEASUREMENT MONETARY NAME NUMERIC PAPER TELEPHONE TIME; do
35 cp -f ${common_objpfx}localedata/de_DE.UTF-8/LC_$f \
36 ${objpfx}localedir/existing-locale
37 done
38 cp -f ${common_objpfx}localedata/de_DE.UTF-8/LC_MESSAGES/SYS_LC_MESSAGES \
39 ${objpfx}localedir/existing-locale/LC_MESSAGES
41 # Create the domain directories.
42 mkdir -p ${objpfx}domaindir/existing-locale/LC_MESSAGES
43 mkdir -p ${objpfx}domaindir/existing-locale/LC_TIME
44 # Populate them.
45 msgfmt -o ${objpfx}domaindir/existing-locale/LC_MESSAGES/existing-domain.mo \
46 -f ../po/de.po
47 msgfmt -o ${objpfx}domaindir/existing-locale/LC_TIME/existing-time-domain.mo \
48 -f ../po/de.po
50 GCONV_PATH=${common_objpfx}iconvdata
51 export GCONV_PATH
52 LOCPATH=${common_objpfx}localedata
53 export LOCPATH
55 # Now run the test.
56 MALLOC_TRACE=$malloc_trace LOCPATH=${objpfx}localedir:$LOCPATH \
57 ${test_program_prefix} \
58 ${objpfx}tst-gettext > ${objpfx}tst-gettext.out ${objpfx}domaindir
60 exit $?