aboutsummaryrefslogtreecommitdiff
path: root/src/pl/tcl/test/runtest
blob: b46604bd3f2ef1809d1ded05d13c3d6945e6f6fd (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
28
29
30
#!/bin/sh

DBNAME=pltcl_test
export DBNAME

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

sleep 1

echo "**** Create test database $DBNAME ****"
createdb $DBNAME || exit 1

echo "**** Create procedural language pltcl ****"
createlang pltcl $DBNAME || exit 1

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."
    rm test.out
else
    echo "    Tests failed - look at diffs between"
    echo "    test.expected and test.out"
fi