b78fc94830a34f5f8be92ca603d2dc8674348427
[platform/upstream/glibc.git] / localedata / tst-numeric.sh
1 #! /bin/sh
2 # Testing the implementation of LC_NUMERIC and snprintf(3).
3 # Copyright (C) 1996, 1997, 1998, 2000, 2003 Free Software Foundation, Inc.
4 # This file is part of the GNU C Library.
5 # Contributed by Jochen Hein <jochen.hein@delphi.central.de>, 1997.
6 #
7
8 # The GNU C Library is free software; you can redistribute it and/or
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
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
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, see
20 # <http://www.gnu.org/licenses/>.
21
22 common_objpfx=$1
23 run_program_prefix=$2
24 datafile=$3
25
26 # Run the tests.
27 errcode=0
28 # There's a TAB for IFS
29 while IFS="     " read locale format value expect; do
30     case "$locale" in '#'*) continue ;; esac
31     if [ -n "$format" ]; then
32         if LOCPATH=${common_objpfx}localedata \
33             GCONV_PATH=${common_objpfx}/iconvdata \
34             ${run_program_prefix} ${common_objpfx}localedata/tst-numeric \
35             "$locale" "$format" "$value" "$expect"
36         then
37             echo "Locale: \"${locale}\" Format: \"${format}\"" \
38                  "Value: \"${value}\" Expect: \"${expect}\"  passed"
39         else
40             errcode=$?
41             echo "Locale: \"${locale}\" Format: \"${format}\"" \
42                  "Value: \"${value}\" Expect: \"${expect}\"    failed"
43         fi
44     fi
45 done < $datafile
46
47 exit $errcode
48 # Local Variables:
49 #  mode:shell-script
50 # End: