]> granicus.if.org Git - postgis/commitdiff
Raster testing added to core testing. Related ticket #762.
authorJorge Arévalo <jorge.arevalo at deimos-space.com>
Fri, 1 Apr 2011 05:18:45 +0000 (05:18 +0000)
committerJorge Arévalo <jorge.arevalo at deimos-space.com>
Fri, 1 Apr 2011 05:18:45 +0000 (05:18 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@6994 b70326c6-7e19-0410-871a-916f4a2858ee

GNUmakefile.in
configure.ac
raster/Makefile.in
raster/rt_pg/Makefile.in
raster/test/Makefile.in
raster/test/core/testapi.c
raster/test/regress/Makefile.in
regress/run_test

index f87d9c0bc913b0d9e1bd02a0ce83a9ca0e43cf72..6000b955e77aa0a0eb097391f256ffc1a7e1aad2 100644 (file)
@@ -5,7 +5,7 @@
 #-----------------------------------------------------
 
 # todo: add all subdirs
-SUBDIRS = liblwgeom regress postgis loader utils raster @TOPOLOGY@
+SUBDIRS = liblwgeom regress postgis loader utils @RASTER@ @TOPOLOGY@
 
 # todo: add more rules here, like uninstall, clean...
 all install uninstall noop clean distclean check:
index a5f767b4785dcc4e8bb194adc470ffd4f63cf110..197d747bd2a3193c6165d05305e24a5ae2e55491 100644 (file)
@@ -730,9 +730,9 @@ dnl ====================================
 AC_ARG_WITH([raster],
     [AS_HELP_STRING([--with-raster],
                     [compile the raster extension (requires GDAL >= 1.6.0) @<:@default=no@:>@])],
-    [RASTER="yes"], [RASTER="no"])
+    [RASTER="raster"], [RASTER=""])
 
-if test "x$RASTER" = "xyes"; then
+if test "x$RASTER" = "xraster"; then
     AC_MSG_RESULT([RASTER: Raster support requested])
 
     AC_CONFIG_HEADERS([raster/raster_config.h])
@@ -884,6 +884,9 @@ except ImportError:
     dnl Activates raster stuff construction.
     BUILD_RASTER=yes
 
+    dnl just in case...
+    AC_SUBST([RASTER])
+
     AC_SUBST([RT_CORE_LIB])
     AC_SUBST([RT_PG_LIB])
     AC_SUBST([RT_POSTGIS_SQL])
index 7eb0367db38e0a8e1539580acf6aadcb3c4a59d7..dd2d365551646abc9e62991726d10e4f1cb2d31f 100644 (file)
 #
 #############################################################################
 
-BUILD_RASTER=@BUILD_RASTER@
 
 all: @RT_CORE_LIB@ @RT_PG_LIB@ @RT_POSTGIS_SQL@ 
 
 corelib:
-ifeq ($(BUILD_RASTER), yes)
        $(MAKE) -C rt_core
-endif
 
 pglib:
-ifeq ($(BUILD_RASTER), yes)
        $(MAKE) -C rt_pg
-endif
 
 rtpostgis.sql:
-ifeq ($(BUILD_RASTER), yes)
        $(MAKE) -C rt_pg rtpostgis.sql
-endif
 
 install: all
-ifeq ($(BUILD_RASTER), yes)
        $(MAKE) -C rt_pg install
        $(MAKE) -C scripts/python install
-endif
 
 uninstall:
-ifeq ($(BUILD_RASTER), yes)
        $(MAKE) -C rt_pg uninstall
        $(MAKE) -C scripts/python uninstall
-endif
 
 clean:
-ifeq ($(BUILD_RASTER), yes)
        $(MAKE) -C rt_core $@
        $(MAKE) -C rt_pg $@
        $(MAKE) -C test $@
        $(MAKE) -C scripts/python $@
-endif
 
 distclean: clean
-ifeq ($(BUILD_RASTER), yes)
        $(RM) -R autom4te.cache
        $(RM) config.status
-endif
 
-check:
-ifeq ($(BUILD_RASTER), yes)
+core-check:
        $(MAKE) -C test $@
-       @echo 
-       @echo "Consider also running make post-install-check after installation"
-       @echo 
-endif
 
-post-install-check: 
-ifeq ($(BUILD_RASTER), yes)
+check: core-check
        $(MAKE) -C test $@
-endif
index 736ddf2c323f2a80d9b5b326640cde664be57c67..a95c4bc2eee4eb1588bd4a8bd4607b183afbf795 100644 (file)
@@ -57,6 +57,15 @@ ifeq ($(PGXSOVERRIDE),1)
        include Makefile.pgxs
 endif
 
+# If REGRESS=1 passed as a parameter, change the default install paths
+# so that no prefix is included. This allows us to relocate to a temporary
+# directory for regression testing.
+ifeq ($(REGRESS),1)
+        bindir=/bin
+        pkglibdir=/lib
+        datadir=/share
+endif
+
 # Borrow the $libdir substitution from PGXS but customise by adding the version number
 %.sql: %.sql.in
        sed 's,MODULE_PATHNAME,$$libdir/rtpostgis-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@,g' $< >$@
index 18380619b4c30dd10ddc6dd8ab8ce28fc1303659..733517644017bbb59c738d774eb85ab636b7f991 100644 (file)
@@ -12,10 +12,10 @@ RT_CORE=../rt_core
 
 all: check
 
-check: $(RT_CORE)/librtcore.a
+core-check: $(RT_CORE)/librtcore.a
        $(MAKE) -C core check
 
-post-install-check: $(RT_CORE)/librtcore.a
+check: core-check
        $(MAKE) -C regress check
 
 $(RT_CORE)/librtcore.a:
index b356a946dfc7baf7065e0f06e9bae0a1184360b5..ffedd3e3faf63a103aae664630af3958a64ea854 100644 (file)
@@ -1116,8 +1116,6 @@ main()
 
                /* First test: NODATA value = -1 */
         rt_raster rt = fillRasterToPolygonize(ctx, 1, -1.0);
-                               
-               printf("*** POLYGONIZE WITH NODATA = -1.0\n");
 
                /* We can check rt_raster_has_no_band here too */
                CHECK(!rt_raster_has_no_band(ctx, rt, 1));
index afabbe12eac5753bdc3d83d7d75d420371c7c937..442a32a8605edf95885fbda5ff2a704cc4095d6d 100644 (file)
@@ -2,6 +2,7 @@
 # $Id$
 #
 # Copyright (c) 2009 Sandro Santilli <strk@keybit.net>, Pierre Racine <pierre.racine@sbf.ulaval.ca>
+# Copyright (c) 2011 Jorge Arevalo <jorge.arevalo@deimos-space.com>
 #
 # This is free software; you can redistribute and/or modify it under
 # the terms of the GNU General Public Licence. See the COPYING file.
 
 POSTGIS_SRC=@POSTGIS_SRCDIR@
 
+# MingW hack: rather than use PGSQL_BINDIR directly, we change
+# to the directory and then use "pwd" to return the path. This
+# ensures that the returned path is in MSYS format, otherwise
+# colons in drive letters will break PATH.
+PGSQL_BINDIR=$(shell cd "@PGSQL_BINDIR@" && pwd)
+
+# Where we put our regression installation
+REGRESS_INSTALLDIR=$(POSTGIS_SRC)/regress/00-regress-install
+
+#
+# Put path from pg_config into front of search path
+#
+PATH := $(PGSQL_BINDIR):$(PATH)
+export PATH
+
 TEST_METADATA = \
        check_raster_columns.sql \
        check_raster_overviews.sql \
@@ -53,8 +69,8 @@ TEST_PIXEL = \
 TEST_UTILITY = \
        create_rt_utility_test.sql \
        rt_utility.sql \
-    create_rt_mapalgebra_test.sql \
-    rt_mapalgebra.sql \
+       create_rt_mapalgebra_test.sql \
+       rt_mapalgebra.sql \
        $(NULL)
 
 TEST_GIST = \
@@ -85,14 +101,29 @@ TESTS = $(TEST_METADATA) $(TEST_IO) $(TEST_FUNC) \
                $(TEST_UTILITY) $(TEST_GIST) $(TEST_SREL) \
                $(TEST_BUGS)
 
-all: run_test
+all:
+       @echo "Use 'make check' to run all tests"
+
+clean distclean:
+       $(RM) -f rtpostgis.sql
+
+rtpostgis.sql: ../../rt_pg/rtpostgis.sql
+       sed 's,$$libdir,$(REGRESS_INSTALLDIR)/lib,g' ../../rt_pg/rtpostgis.sql > rtpostgis.sql
+
+
+check: rtpostgis.sql
+       $(MAKE) -C ../../../regress postgis.sql staged-install
+       $(MAKE) -C ../../rt_pg REGRESS=1 DESTDIR=$(REGRESS_INSTALLDIR) install
+       @USE_VERSION=$(POSTGIS_PGSQL_VERSION) ../../../regress/run_test --raster $(TESTS)
+
+#all: run_test
 
-run_test: run_test.in Makefile
-       sed -e "s#@POSTGIS_SRC@#$(POSTGIS_SRC)#" $< > $@
-       chmod +x $@
+#run_test: run_test.in Makefile
+#      sed -e "s#@POSTGIS_SRC@#$(POSTGIS_SRC)#" $< > $@
+#      chmod +x $@
 
-post-install-check check: run_test
-       ./run_test $(TESTS)
+#post-install-check check: run_test
+#      ./run_test $(TESTS)
 
-clean:
-       $(RM) run_test
+#clean:
+#      $(RM) run_test
index 6477418d0f4aec402d783db02f88214552127819..b03885e78d844fc93f218fc1676016ab57ccd4d6 100755 (executable)
@@ -462,7 +462,7 @@ if test -z "$db_exists"; then
                fi
                if test x"$OPT_WITH_RASTER" = "xyes"; then
                        if test -e ${REGDIR}/../raster/rt_pg/rtpostgis.sql; then
-                               echo "Adding topology support" 
+                               echo "Adding raster support"
                                ${PSQL} ${_psql_opts} -Xf ${REGDIR}/../raster/rt_pg/rtpostgis.sql "${DB}" >> ${TMPDIR}/regress_log 2>&1
                        else
                                echo "Raster support skipped (rtpostgis.sql  not found)"