aboutsummaryrefslogtreecommitdiff
path: root/src/pl/tcl/test/runtest
blob: 08b55e1b1b9f12e7b5ab60f4bfd67fd561d27c21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

DBNAME=pltcl_test
export DBNAME

echo "**** Destroy old database $DBNAME ****"
destroydb $DBNAME

echo "**** Create test database $DBNAME ****"
createdb $DBNAME

echo "**** Create procedural language pltcl ****"
psql -q -n $DBNAME <test_mklang.sql

echo "**** Create tables, functions and triggers ****"
psql -q -n $DBNAME <test_setup.sql

echo "**** Running test queries ****"
psql -q -n -e $DBNAME <test_queries.sql > test.out 2>&1

if diff test.expected test.out >/dev/null 2>&1 ; then
    echo "    Tests passed O.K."
else
    echo "    Tests faild - look at diffs between"
    echo "    test.expected and test.out"
fi