[postgis-tickets] r15185 - Add script to check all upgrade paths

Sandro Santilli strk at kbt.io
Fri Oct 7 08:43:39 PDT 2016


Author: strk
Date: 2016-10-07 08:43:39 -0700 (Fri, 07 Oct 2016)
New Revision: 15185

Added:
   trunk/utils/check_all_upgrades.sh
Log:
Add script to check all upgrade paths

Added: trunk/utils/check_all_upgrades.sh
===================================================================
--- trunk/utils/check_all_upgrades.sh	                        (rev 0)
+++ trunk/utils/check_all_upgrades.sh	2016-10-07 15:43:39 UTC (rev 15185)
@@ -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


Property changes on: trunk/utils/check_all_upgrades.sh
___________________________________________________________________
Added: svn:executable
   + *



More information about the postgis-tickets mailing list