db3653ad735e976160446b3a11f66852af0d6701
[platform/upstream/glibc.git] / intl / tst-gettext.sh
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.
5 #
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.
10 #
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.
15 #
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.
20
21 common_objpfx=$1
22 objpfx=$2
23
24 # Generate the test data.
25 test -d ${objpfx}domaindir || mkdir ${objpfx}domaindir
26 # Create the locale directories.
27 test -d ${objpfx}domaindir/existing-locale || mkdir ${objpfx}domaindir/existing-locale
28 test -d ${objpfx}domaindir/existing-locale/LC_MESSAGES || mkdir ${objpfx}domaindir/existing-locale/LC_MESSAGES
29 test -d ${objpfx}domaindir/existing-locale/LC_TIME || mkdir ${objpfx}domaindir/existing-locale/LC_TIME
30
31 # Populate them.
32 msgfmt -o ${objpfx}domaindir/existing-locale/LC_MESSAGES/existing-domain.mo \
33        ../po/de.po
34 msgfmt -o ${objpfx}domaindir/existing-locale/LC_TIME/existing-time-domain.mo \
35        ../po/de.po
36
37 # Now run the test.
38 ${common_objpfx}elf/ld.so --library-path $common_objpfx \
39 ${objpfx}tst-gettext > ${objpfx}tst-gettext.out ${objpfx}domaindir
40
41 exit $?