]> git.ipfire.org Git - thirdparty/glibc.git/blame - localedata/tst-fmon.sh
Update.
[thirdparty/glibc.git] / localedata / tst-fmon.sh
CommitLineData
39e16978 1#! /bin/sh
49891c10 2# Testing the implementation of strfmon(3).
a234e27d 3# Copyright (C) 1996, 1997, 1998, 2000, 2003 Free Software Foundation, Inc.
49891c10
UD
4# This file is part of the GNU C Library.
5# Contributed by Jochen Hein <jochen.hein@delphi.central.de>, 1997.
6#
41bdb6e2 7
49891c10 8# The GNU C Library is free software; you can redistribute it and/or
41bdb6e2
AJ
9# modify it under the terms of the GNU Lesser General Public
10# License as published by the Free Software Foundation; either
11# version 2.1 of the License, or (at your option) any later version.
12
49891c10
UD
13# The GNU C Library is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
41bdb6e2
AJ
16# Lesser General Public License for more details.
17
18# You should have received a copy of the GNU Lesser General Public
19# License along with the GNU C Library; if not, write to the Free
20# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21# 02111-1307 USA.
39e16978 22
49891c10 23common_objpfx=$1
9f835f5f
UD
24run_program_prefix=$2
25datafile=$3
39e16978
UD
26
27here=`pwd`
28
8956ac9e 29lang=`sed -e '/^#/d' -e '/^$/d' -e '/^C /d' -e '/^tstfmon/d' -e 's/^\([^ ]*\).*/\1/' $datafile | sort | uniq`
49891c10 30
39e16978 31# Generate data files.
8956ac9e
UD
32for cns in `cd ./tst-fmon-locales && ls tstfmon_*`; do
33 cn=tst-fmon-locales/$cns
34 fn=charmaps/ISO-8859-1
4a9e89d5 35 I18NPATH=. GCONV_PATH=${common_objpfx}iconvdata \
83b1b6d8 36 LOCPATH=${common_objpfx}localedata LC_ALL=C LANGUAGE=C \
9f835f5f 37 ${run_program_prefix} ${common_objpfx}locale/localedef \
8956ac9e
UD
38 --quiet -i $cn -f $fn ${common_objpfx}localedata/$cns
39done
39e16978
UD
40
41# Run the tests.
4cfde896 42errcode=0
9f835f5f
UD
43# There's a TAB for IFS
44while IFS=" " read locale format value expect; do
a234e27d 45 case "$locale" in '#'*) continue ;; esac
49891c10 46 if [ -n "$format" ]; then
4cfde896
UD
47 if LOCPATH=${common_objpfx}localedata \
48 GCONV_PATH=${common_objpfx}/iconvdata \
49 ${run_program_prefix} ${common_objpfx}localedata/tst-fmon \
50 "$locale" "$format" "$value" "$expect" ; then
ca41028b
UD
51 echo "Locale: \"${locale}\" Format: \"${format}\"" \
52 "Value: \"${value}\" Expect: \"${expect}\" passed"
49891c10 53 else
4cfde896 54 errcode=$?
49891c10
UD
55 echo "Locale: \"${locale}\" Format: \"${format}\"" \
56 "Value: \"${value}\" Expect: \"${expect}\" failed"
49891c10
UD
57 fi
58 fi
14e9dd67 59done < $datafile
39e16978 60
4cfde896 61exit $errcode
39e16978
UD
62# Local Variables:
63# mode:shell-script
64# End: