]> granicus.if.org Git - postgis/commitdiff
Add check-installed-upgrades rule under extensions
authorSandro Santilli <strk@keybit.net>
Tue, 24 Nov 2015 09:22:39 +0000 (09:22 +0000)
committerSandro Santilli <strk@keybit.net>
Tue, 24 Nov 2015 09:22:39 +0000 (09:22 +0000)
The rule runs upgrade tests for all available extension
upgrade paths. Mostly fails, due to the features checked not
always being available in the installed versions of the extension,
but is a good starting point to improve the testing coverage.

git-svn-id: http://svn.osgeo.org/postgis/trunk@14421 b70326c6-7e19-0410-871a-916f4a2858ee

extensions/upgradeable_versions.mk

index 70cacea593ad23b5865984d2067689da87bd2ec5..5780dbb5e2ac81c39caa039b95fd0d3d66ab4a3b 100644 (file)
@@ -19,3 +19,29 @@ UPGRADEABLE_VERSIONS = \
        2.1.9 \
        2.2.0 \
        2.2.1
+
+check-installed-upgrades:
+       MODULE=$(EXTENSION); \
+       TOVER=$(EXTVERSION); \
+  EXDIR=`$(PG_CONFIG) --sharedir`/extension; \
+       echo MODULE=$${MODULE}; \
+       echo TOVER=$${TOVER}; \
+       echo EXDIR=$${EXDIR}; \
+  ls $${EXDIR}/$${MODULE}--*--$${TOVER}.sql \
+        | grep -v unpackaged \
+        | while read fname; do \
+    p=`echo "$${fname}" | sed "s/.*$${MODULE}--//;s/\.sql$$//"`;  \
+    FROM=`echo $${p} | sed 's/--.*//'`; \
+    FF="$${EXDIR}/$${MODULE}--$${FROM}.sql"; \
+    if test -f "$${FF}"; then \
+      echo "Testing upgrade path $$p"; \
+      $(MAKE) -C ../.. installcheck \
+        RUNTESTFLAGS="-v --extension --upgrade-path $$p" \
+        || { \
+        echo "Upgrade path $$p failed FF=$${FF}"; \
+        exit 1; }; \
+    else \
+        echo "No install available for upgradeable ext version $${FROM}"; \
+    fi; \
+  done; \
+