Dirty SQL test system

* Added a system that allows "dirty" tests to be written. These tests
actually need to change the database, so a temporary test database must
be created to run them.
This commit is contained in:
Emmanuel BENOîT 2012-01-14 09:02:24 +01:00
parent 04e550709a
commit c18bdc2d1f
5 changed files with 114 additions and 17 deletions

View file

@ -9,8 +9,8 @@ user=tests
password=tests
EOF
fi
TEST_DATABASE="`grep ^db= db-config.txt | sed -e s/.*=//`"
TEST_USER="`grep ^user= db-config.txt | sed -e s/.*=//`"
export TEST_DATABASE="`grep ^db= db-config.txt | sed -e s/.*=//`"
export TEST_USER="`grep ^user= db-config.txt | sed -e s/.*=//`"
echo
echo
@ -53,3 +53,6 @@ fi
if [ -d user ]; then
pg_prove -U $TEST_USER -d $TEST_DATABASE `find user/ -type f -name '*.sql'` || exit 1
fi
if [ -x dirty/run-dirty-tests.sql ]; then
( cd dirty; exec ./run-dirty-tests.sql ) || exit 1
fi