Speed up strcoll by inlining
[glibc.git] / localedata / sort-test.sh
blobe37129a032ddebea0ae60febfe92452dc323adef
1 #! /bin/sh
2 # Test collation using xfrm-test.
3 # Copyright (C) 1997-2014 Free Software Foundation, Inc.
4 # This file is part of the GNU C Library.
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.
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.
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/>.
20 set -e
22 common_objpfx=$1; shift
23 test_program_prefix_before_env=$1; shift
24 run_program_env=$1; shift
25 test_program_prefix_after_env=$1; shift
26 lang=$*
28 id=${PPID:-100}
29 here=`pwd`
31 # Run collation tests.
32 status=0
33 for l in $lang; do
34 here=0
35 cns=`echo $l | sed 's/\(.*\)[.][^.]*/\1/'`
36 ${test_program_prefix_before_env} \
37 ${run_program_env} \
38 LC_ALL=$l ${test_program_prefix_after_env} \
39 ${common_objpfx}localedata/collate-test $id < $cns.in \
40 > ${common_objpfx}localedata/$cns.out || here=1
41 cmp -s $cns.in ${common_objpfx}localedata/$cns.out || here=1
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
50 ${test_program_prefix_before_env} \
51 ${run_program_env} \
52 LC_ALL=$l ${test_program_prefix_after_env} \
53 ${common_objpfx}localedata/xfrm-test $id < $cns.in \
54 > ${common_objpfx}localedata/$cns.xout || here=1
55 cmp -s $cns.in ${common_objpfx}localedata/$cns.xout || here=1
56 if test $here -eq 0; then
57 echo "$l xfrm-test OK"
58 else
59 echo "$l xfrm-test FAIL"
60 diff -u $cns.in ${common_objpfx}localedata/$cns.xout | sed 's/^/ /'
61 status=1
63 done
65 exit $status
66 # Local Variables:
67 # mode:shell-script
68 # End: