]> git.ipfire.org Git - thirdparty/glibc.git/blame - localedata/sort-test.sh
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / localedata / sort-test.sh
CommitLineData
f5f52655 1#! /bin/sh
9a9028b1 2# Test collation using xfrm-test.
f7a9f785 3# Copyright (C) 1997-2016 Free Software Foundation, Inc.
9a9028b1
DL
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/>.
f5f52655 19
57c69bef
DL
20set -e
21
f5f52655 22common_objpfx=$1; shift
8540f6d2
JM
23test_program_prefix_before_env=$1; shift
24run_program_env=$1; shift
25test_program_prefix_after_env=$1; shift
f5f52655
UD
26lang=$*
27
28id=${PPID:-100}
29here=`pwd`
30
f5f52655
UD
31# Run collation tests.
32status=0
33for l in $lang; do
ca41028b 34 here=0
f5f52655 35 cns=`echo $l | sed 's/\(.*\)[.][^.]*/\1/'`
8540f6d2
JM
36 ${test_program_prefix_before_env} \
37 ${run_program_env} \
38 LC_ALL=$l ${test_program_prefix_after_env} \
14e9dd67 39 ${common_objpfx}localedata/collate-test $id < $cns.in \
ca41028b
UD
40 > ${common_objpfx}localedata/$cns.out || here=1
41 cmp -s $cns.in ${common_objpfx}localedata/$cns.out || here=1
973fcec8
UD
42 if test $here -eq 0; then
43 echo "$l collate-test OK"
44 else
45 echo "$l collate-test FAIL"
46 diff -u $cns.in ${common_objpfx}localedata/$cns.out | sed 's/^/ /'
47 status=1
48 fi
f5f52655 49
8540f6d2
JM
50 ${test_program_prefix_before_env} \
51 ${run_program_env} \
52 LC_ALL=$l ${test_program_prefix_after_env} \
14e9dd67 53 ${common_objpfx}localedata/xfrm-test $id < $cns.in \
ca41028b
UD
54 > ${common_objpfx}localedata/$cns.xout || here=1
55 cmp -s $cns.in ${common_objpfx}localedata/$cns.xout || here=1
0f9e5854
LH
56 ${test_program_prefix_before_env} \
57 ${run_program_env} \
58 LC_ALL=$l ${test_program_prefix_after_env} \
59 ${common_objpfx}localedata/xfrm-test $id -nocache < $cns.in \
60 > ${common_objpfx}localedata/$cns.nocache.xout || here=1
61 cmp -s $cns.in ${common_objpfx}localedata/$cns.nocache.xout || here=1
ca41028b 62 if test $here -eq 0; then
973fcec8 63 echo "$l xfrm-test OK"
ca41028b 64 else
973fcec8
UD
65 echo "$l xfrm-test FAIL"
66 diff -u $cns.in ${common_objpfx}localedata/$cns.xout | sed 's/^/ /'
0f9e5854 67 diff -u $cns.in ${common_objpfx}localedata/$cns.nocache.xout | sed 's/^/ /'
ca41028b
UD
68 status=1
69 fi
f5f52655
UD
70done
71
72exit $status
73# Local Variables:
39e16978 74# mode:shell-script
f5f52655 75# End: