]> git.ipfire.org Git - thirdparty/glibc.git/blob - localedata/sort-test.sh
Add copyright notices to testsuite shell scripts
[thirdparty/glibc.git] / localedata / sort-test.sh
1 #! /bin/sh
2 # Test collation using xfrm-test.
3 # Copyright (C) 1997-2004 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 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.
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 # Lesser General Public License for more details.
15
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/>.
19
20 common_objpfx=$1; shift
21 run_program_prefix=$1; shift
22 lang=$*
23
24 id=${PPID:-100}
25 here=`pwd`
26
27 # Run collation tests.
28 status=0
29 for l in $lang; do
30 here=0
31 cns=`echo $l | sed 's/\(.*\)[.][^.]*/\1/'`
32 LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}/iconvdata \
33 LC_ALL=$l ${run_program_prefix} \
34 ${common_objpfx}localedata/collate-test $id < $cns.in \
35 > ${common_objpfx}localedata/$cns.out || here=1
36 cmp -s $cns.in ${common_objpfx}localedata/$cns.out || here=1
37 if test $here -eq 0; then
38 echo "$l collate-test OK"
39 else
40 echo "$l collate-test FAIL"
41 diff -u $cns.in ${common_objpfx}localedata/$cns.out | sed 's/^/ /'
42 status=1
43 fi
44
45 LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}/iconvdata \
46 LC_ALL=$l ${run_program_prefix} \
47 ${common_objpfx}localedata/xfrm-test $id < $cns.in \
48 > ${common_objpfx}localedata/$cns.xout || here=1
49 cmp -s $cns.in ${common_objpfx}localedata/$cns.xout || here=1
50 if test $here -eq 0; then
51 echo "$l xfrm-test OK"
52 else
53 echo "$l xfrm-test FAIL"
54 diff -u $cns.in ${common_objpfx}localedata/$cns.xout | sed 's/^/ /'
55 status=1
56 fi
57 done
58
59 exit $status
60 # Local Variables:
61 # mode:shell-script
62 # End: