Skip to content

Commit cdf05ac

Browse files
author
Sandro Santilli
committedFeb 17, 2016
Add script to create and initialize postgis test database
1 parent bc7036f commit cdf05ac

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed
 

‎tests/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,15 @@ If this does not match your setup you can set the environment variable
5252
on standard libpq environment variables to tweak host, port user and
5353
password (PGHOST, PGPORT, PGUSER, PGPASSWORD).
5454

55-
Please note that the database needs to be initialized using the sql-script
55+
Please note that the database needs to be initialized using
56+
the sql-scripts:
5657

5758
tests/testdata/provider/testdata_pg*.sql
5859

5960
They take care of activating postgis for the test database and
6061
create some tables containing test data.
62+
63+
For convenience, a shell script is provided to create the database
64+
and initialize it as needed:
65+
66+
tests/testdata/provider/testdata_pg.sh
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
3+
SCRIPTS="
4+
tests/testdata/provider/testdata_pg.sql
5+
tests/testdata/provider/testdata_pg_reltests.sql
6+
tests/testdata/provider/testdata_pg_vectorjoin.sql
7+
"
8+
9+
createdb qgis_test || exit 1
10+
for f in ${SCRIPTS}; do
11+
psql -f $f qgis_test --set ON_ERROR_STOP=1 || exit 1
12+
done

0 commit comments

Comments
 (0)
Failed to load comments.