~ubuntu-branches/ubuntu/lucid/postgresql-8.4/lucid-security

« back to all changes in this revision

Viewing changes to src/test/mb/mbregress.sh

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-03-20 12:00:13 UTC
  • Revision ID: james.westby@ubuntu.com-20090320120013-hogj7egc5mjncc5g
Tags: upstream-8.4~0cvs20090328
ImportĀ upstreamĀ versionĀ 8.4~0cvs20090328

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
# $PostgreSQL$
 
3
 
 
4
if echo '\c' | grep -s c >/dev/null 2>&1
 
5
then
 
6
        ECHO_N="echo -n"
 
7
        ECHO_C=""
 
8
else
 
9
        ECHO_N="echo"
 
10
        ECHO_C='\c'
 
11
fi
 
12
 
 
13
if [ ! -d results ];then
 
14
    mkdir results
 
15
fi
 
16
 
 
17
dropdb utf8
 
18
createdb -E UTF8 utf8
 
19
 
 
20
PSQL="psql -n -e -q"
 
21
tests="euc_jp sjis euc_kr euc_cn euc_tw big5 utf8 mule_internal"
 
22
unset PGCLIENTENCODING
 
23
for i in $tests
 
24
do
 
25
        $ECHO_N "${i} .. " $ECHO_C
 
26
 
 
27
        if [ $i = sjis ];then
 
28
                PGCLIENTENCODING=SJIS
 
29
                export PGCLIENTENCODING
 
30
                $PSQL euc_jp < sql/sjis.sql > results/sjis.out 2>&1
 
31
                unset PGCLIENTENCODING
 
32
        elif [ $i = big5 ];then
 
33
                PGCLIENTENCODING=BIG5
 
34
                export PGCLIENTENCODING
 
35
                $PSQL euc_tw < sql/big5.sql > results/big5.out 2>&1
 
36
                unset PGCLIENTENCODING
 
37
        else
 
38
                dropdb $i >/dev/null 2>&1
 
39
                createdb -E `echo $i | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` $i >/dev/null
 
40
                $PSQL $i < sql/${i}.sql > results/${i}.out 2>&1
 
41
        fi
 
42
 
 
43
        if [ -f expected/${i}-${SYSTEM}.out ]
 
44
        then
 
45
                EXPECTED="expected/${i}-${SYSTEM}.out"
 
46
        else
 
47
                EXPECTED="expected/${i}.out"
 
48
        fi
 
49
  
 
50
        if [ `diff ${EXPECTED} results/${i}.out | wc -l` -ne 0 ]
 
51
        then
 
52
                ( diff -wC3 ${EXPECTED} results/${i}.out; \
 
53
                echo "";  \
 
54
                echo "----------------------"; \
 
55
                echo "" ) >> regression.diffs
 
56
                echo failed
 
57
        else
 
58
                echo ok
 
59
        fi
 
60
done