Set MALLOC_CHECK_ and MALLOC_PERTURB_
[platform/upstream/glib.git] / tests / run-collate-tests.sh
1 #! /bin/sh
2
3 fail ()
4 {
5   echo "Test failed: $*"
6   exit 1
7 }
8
9 echo_v ()
10 {
11   if [ "$verbose" = "1" ]; then
12     echo "$*"
13   fi
14 }
15
16 LANG=en_US
17 error_out=/dev/null
18 if [ "$1" = "-v" ]; then
19   verbose=1
20   error_out=/dev/stderr
21 fi  
22 for I in ${srcdir:-.}/collate/*.in; do
23   echo_v "Sorting $I"
24   name=`basename $I .in`
25   ./unicode-collate $I > collate.out
26   if ! diff collate.out ${srcdir:-.}/collate/$name.unicode; then 
27     fail "unexpected error when using g_utf8_collate() on $I"
28   fi  
29   ./unicode-collate --key $I > collate.out
30   if ! diff collate.out ${srcdir:-.}/collate/$name.unicode; then 
31     fail "unexpected error when using g_utf8_collate_key() on $I"
32   fi  
33   ./unicode-collate --file $I > collate.out
34   if ! diff collate.out ${srcdir:-.}/collate/$name.file; then 
35     fail "unexpected error when using g_utf8_collate_key_for_filename() on $I"
36   fi  
37 done
38
39 echo_v "All tests passed."