File: runtest

package info (click to toggle)
postgresql-plruby 0.5.0-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,432 kB
  • ctags: 1,252
  • sloc: ansic: 8,193; sql: 1,841; ruby: 880; makefile: 63; sh: 62
file content (26 lines) | stat: -rw-r--r-- 572 bytes parent folder | download | duplicates (12)
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
#!/bin/sh

DBNAME=plruby_test
export DBNAME

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

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

echo "**** Create procedural language plruby$2 ****"
ruby b.rb $*
psql -q -n $DBNAME <test_mklang.sql

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

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