aboutsummaryrefslogtreecommitdiff
path: root/src/pl/tcl/test/runtest
blob: c98402f0abd6b017f2312409cff75e9208dbd400 (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 ****"
dropdb $DBNAME

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

echo "**** Create procedural language pltcl ****"
createlang pltcl $DBNAME

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