Add script to create and initialize postgis test database

This commit is contained in:
Sandro Santilli 2016-02-17 11:08:18 +01:00
parent bc7036fd55
commit cdf05acac8
2 changed files with 19 additions and 1 deletions

View File

@ -52,9 +52,15 @@ If this does not match your setup you can set the environment variable
on standard libpq environment variables to tweak host, port user and
password (PGHOST, PGPORT, PGUSER, PGPASSWORD).
Please note that the database needs to be initialized using the sql-script
Please note that the database needs to be initialized using
the sql-scripts:
tests/testdata/provider/testdata_pg*.sql
They take care of activating postgis for the test database and
create some tables containing test data.
For convenience, a shell script is provided to create the database
and initialize it as needed:
tests/testdata/provider/testdata_pg.sh

12
tests/testdata/provider/testdata_pg.sh vendored Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
SCRIPTS="
tests/testdata/provider/testdata_pg.sql
tests/testdata/provider/testdata_pg_reltests.sql
tests/testdata/provider/testdata_pg_vectorjoin.sql
"
createdb qgis_test || exit 1
for f in ${SCRIPTS}; do
psql -f $f qgis_test --set ON_ERROR_STOP=1 || exit 1
done