]> granicus.if.org Git - postgis/commitdiff
Stop on first error when creating the regress db
authorSandro Santilli <strk@keybit.net>
Wed, 16 Feb 2011 10:19:28 +0000 (10:19 +0000)
committerSandro Santilli <strk@keybit.net>
Wed, 16 Feb 2011 10:19:28 +0000 (10:19 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@6829 b70326c6-7e19-0410-871a-916f4a2858ee

regress/run_test

index 831d52bc541a2a331cfb8cfcad348dd9dcc14861..ee6548f43a4ee8e3d7b1765f460b878771badff7 100755 (executable)
@@ -409,13 +409,16 @@ if test -z "$db_exists"; then
        if test x"$OPT_CREATE" = "xyes"; then
                echo "Creating spatial db ${DB} " 
 
+               # ON_ERROR_STOP is used by psql to return non-0 on an error
+               _psql_opts="--no-psqlrc --variable ON_ERROR_STOP=true"
+
                createdb "${DB}" > ${TMPDIR}/regress_log
                createlang plpgsql "${DB}" >> ${TMPDIR}/regress_log
-               ${PSQL} -Xf ${REGDIR}/postgis.sql "${DB}" >> ${TMPDIR}/regress_log 2>&1
+               ${PSQL} ${_psql_opts} -Xf ${REGDIR}/postgis.sql "${DB}" >> ${TMPDIR}/regress_log 2>&1
                if test x"$OPT_WITH_TOPO" = "xyes"; then
                        if test -e ${REGDIR}/../topology/topology.sql; then
                                echo "Adding topology support" 
-                               ${PSQL} -Xf ${REGDIR}/../topology/topology.sql "${DB}" >> ${TMPDIR}/regress_log 2>&1
+                               ${PSQL} ${_psql_opts} -Xf ${REGDIR}/../topology/topology.sql "${DB}" >> ${TMPDIR}/regress_log 2>&1
                        else
                                echo "Topology support skipped (topology.sql  not found)" 
                        fi