]> granicus.if.org Git - postgis/commitdiff
Add script to check all upgrade paths
authorSandro Santilli <strk@kbt.io>
Fri, 7 Oct 2016 15:43:39 +0000 (15:43 +0000)
committerSandro Santilli <strk@kbt.io>
Fri, 7 Oct 2016 15:43:39 +0000 (15:43 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@15185 b70326c6-7e19-0410-871a-916f4a2858ee

utils/check_all_upgrades.sh [new file with mode: 0755]

diff --git a/utils/check_all_upgrades.sh b/utils/check_all_upgrades.sh
new file mode 100755 (executable)
index 0000000..8ca8bd0
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+if test -z "$1"; then
+  echo "Usage: $0 <to_version>" >&2
+  exit 1
+fi
+to_version="$1"
+
+BUILDDIR=$PWD
+EXTDIR=`pg_config --sharedir`/extension/
+RET=0
+
+cd $EXTDIR
+'ls' postgis--* | grep -v -- '--.*--' |
+sed 's/^postgis--\(.*\)\.sql/\1/' | while read fname; do
+  from_version="$fname"
+  UPGRADE_PATH="${from_version}--${to_version}"
+  if test -e postgis--${UPGRADE_PATH}.sql; then
+    echo "Testing upgrade $UPGRADE_PATH"
+    export RUNTESTFLAGS="-v --extension --upgrade-path=${UPGRADE_PATH}"
+    make -C ${BUILDDIR}/regress check
+    ret=$?
+    echo "UPGRADE TEST EXIT CODE: $ret"
+    if test $ret -ne 0; then
+      cat /tmp/pgis_reg/regress_log
+    fi
+    RET=$((RET+$ret))
+    dropdb postgis_reg
+  else
+    echo "Missing script for $UPGRADE_PATH upgrade" >&2
+  fi
+done
+
+exit $RET