| 1 | # ********************************************************************** |
|---|
| 2 | # * |
|---|
| 3 | # * PostGIS - Spatial Types for PostgreSQL |
|---|
| 4 | # * http://postgis.refractions.net |
|---|
| 5 | # * |
|---|
| 6 | # * Copyright (C) 2011-2012 Sandro Santilli <strk@keybit.net> |
|---|
| 7 | # * Copyright (C) 2009-2011 Paul Ramsey <pramsey@cleverelephant.ca> |
|---|
| 8 | # * Copyright (C) 2008-2009 Mark Cave-Ayland |
|---|
| 9 | # * |
|---|
| 10 | # * This is free software; you can redistribute and/or modify it under |
|---|
| 11 | # * the terms of the GNU General Public Licence. See the COPYING file. |
|---|
| 12 | # * |
|---|
| 13 | # ********************************************************************** |
|---|
| 14 | |
|---|
| 15 | PERL=@PERL@ |
|---|
| 16 | TMPDIR?=/tmp |
|---|
| 17 | |
|---|
| 18 | POSTGIS_PGSQL_VERSION=@POSTGIS_PGSQL_VERSION@ |
|---|
| 19 | POSTGIS_GEOS_VERSION=@POSTGIS_GEOS_VERSION@ |
|---|
| 20 | POSTGIS_PROJ_VERSION=@POSTGIS_PROJ_VERSION@ |
|---|
| 21 | HAVE_JSON=@HAVE_JSON@ |
|---|
| 22 | MINGWBUILD=@MINGWBUILD@ |
|---|
| 23 | |
|---|
| 24 | # MingW hack: rather than use PGSQL_BINDIR directly, we change |
|---|
| 25 | # to the directory and then use "pwd" to return the path. This |
|---|
| 26 | # ensures that the returned path is in MSYS format, otherwise |
|---|
| 27 | # colons in drive letters will break PATH. |
|---|
| 28 | PGSQL_BINDIR=$(shell cd "@PGSQL_BINDIR@" && pwd) |
|---|
| 29 | |
|---|
| 30 | # Where we put our regression installation |
|---|
| 31 | ifeq ($(MINGWBUILD),1) |
|---|
| 32 | srcdir=$(shell bash -c "pwd -W") |
|---|
| 33 | else |
|---|
| 34 | srcdir=$(shell pwd) |
|---|
| 35 | endif |
|---|
| 36 | REGRESS_INSTALLDIR=$(srcdir)/00-regress-install |
|---|
| 37 | |
|---|
| 38 | # |
|---|
| 39 | # Put path from pg_config into front of search path |
|---|
| 40 | # |
|---|
| 41 | PATH := $(PGSQL_BINDIR):$(PATH) |
|---|
| 42 | export PATH |
|---|
| 43 | |
|---|
| 44 | |
|---|
| 45 | TESTS = \ |
|---|
| 46 | loader/Point \ |
|---|
| 47 | loader/PointM \ |
|---|
| 48 | loader/PointZ \ |
|---|
| 49 | loader/MultiPoint \ |
|---|
| 50 | loader/MultiPointM \ |
|---|
| 51 | loader/MultiPointZ \ |
|---|
| 52 | loader/Arc \ |
|---|
| 53 | loader/ArcM \ |
|---|
| 54 | loader/ArcZ \ |
|---|
| 55 | loader/Polygon \ |
|---|
| 56 | loader/PolygonM \ |
|---|
| 57 | loader/PolygonZ \ |
|---|
| 58 | loader/TSTPolygon \ |
|---|
| 59 | loader/TSIPolygon \ |
|---|
| 60 | loader/TSTIPolygon \ |
|---|
| 61 | loader/PointWithSchema \ |
|---|
| 62 | loader/NoTransPoint \ |
|---|
| 63 | loader/NotReallyMultiPoint \ |
|---|
| 64 | loader/MultiToSinglePoint \ |
|---|
| 65 | loader/ReprojectPts \ |
|---|
| 66 | loader/ReprojectPtsGeog \ |
|---|
| 67 | loader/Latin1 \ |
|---|
| 68 | binary \ |
|---|
| 69 | regress \ |
|---|
| 70 | regress_index \ |
|---|
| 71 | regress_index_nulls \ |
|---|
| 72 | lwgeom_regress \ |
|---|
| 73 | regress_lrs \ |
|---|
| 74 | removepoint \ |
|---|
| 75 | setpoint \ |
|---|
| 76 | simplify \ |
|---|
| 77 | snaptogrid \ |
|---|
| 78 | summary \ |
|---|
| 79 | affine \ |
|---|
| 80 | empty \ |
|---|
| 81 | measures \ |
|---|
| 82 | legacy \ |
|---|
| 83 | long_xact \ |
|---|
| 84 | ctors \ |
|---|
| 85 | sql-mm-serialize \ |
|---|
| 86 | sql-mm-circularstring \ |
|---|
| 87 | sql-mm-compoundcurve \ |
|---|
| 88 | sql-mm-curvepoly \ |
|---|
| 89 | sql-mm-general \ |
|---|
| 90 | sql-mm-multicurve \ |
|---|
| 91 | sql-mm-multisurface \ |
|---|
| 92 | polyhedralsurface \ |
|---|
| 93 | polygonize \ |
|---|
| 94 | postgis_type_name \ |
|---|
| 95 | out_geometry \ |
|---|
| 96 | out_geography \ |
|---|
| 97 | in_gml \ |
|---|
| 98 | in_kml \ |
|---|
| 99 | iscollection \ |
|---|
| 100 | regress_ogc \ |
|---|
| 101 | regress_ogc_cover \ |
|---|
| 102 | regress_ogc_prep \ |
|---|
| 103 | regress_bdpoly \ |
|---|
| 104 | regress_proj \ |
|---|
| 105 | regress_management \ |
|---|
| 106 | dump \ |
|---|
| 107 | dumppoints \ |
|---|
| 108 | wmsservers \ |
|---|
| 109 | wkt \ |
|---|
| 110 | wkb \ |
|---|
| 111 | tickets \ |
|---|
| 112 | typmod \ |
|---|
| 113 | remove_repeated_points \ |
|---|
| 114 | split \ |
|---|
| 115 | relate \ |
|---|
| 116 | bestsrid \ |
|---|
| 117 | concave_hull |
|---|
| 118 | |
|---|
| 119 | ifeq ($(shell expr $(POSTGIS_GEOS_VERSION) ">=" 32),1) |
|---|
| 120 | # GEOS-3.3 adds: |
|---|
| 121 | # ST_HausdorffDistance, ST_Buffer(params) |
|---|
| 122 | TESTS += \ |
|---|
| 123 | hausdorff \ |
|---|
| 124 | regress_buffer_params |
|---|
| 125 | endif |
|---|
| 126 | |
|---|
| 127 | ifeq ($(shell expr $(POSTGIS_GEOS_VERSION) ">=" 33),1) |
|---|
| 128 | # GEOS-3.3 adds: |
|---|
| 129 | # ST_RelateMatch, ST_IsValidDetail, ST_SharedPaths , |
|---|
| 130 | # ST_Snap, ST_UnaryUnion, ST_MakeClean |
|---|
| 131 | TESTS += \ |
|---|
| 132 | offsetcurve \ |
|---|
| 133 | relatematch \ |
|---|
| 134 | isvaliddetail \ |
|---|
| 135 | sharedpaths \ |
|---|
| 136 | snap \ |
|---|
| 137 | node \ |
|---|
| 138 | unaryunion \ |
|---|
| 139 | clean \ |
|---|
| 140 | relate_bnr |
|---|
| 141 | endif |
|---|
| 142 | |
|---|
| 143 | ifeq ($(HAVE_JSON),yes) |
|---|
| 144 | # JSON-C adds: |
|---|
| 145 | # ST_GeomFromGeoJSON() |
|---|
| 146 | TESTS += \ |
|---|
| 147 | in_geojson |
|---|
| 148 | endif |
|---|
| 149 | |
|---|
| 150 | all install uninstall: |
|---|
| 151 | |
|---|
| 152 | distclean: clean |
|---|
| 153 | rm Makefile |
|---|
| 154 | |
|---|
| 155 | staged-install-topology: |
|---|
| 156 | @if test x"@TOPOLOGY@" != "x"; then \ |
|---|
| 157 | $(MAKE) -C ../topology REGRESS=1 DESTDIR=$(REGRESS_INSTALLDIR) install; \ |
|---|
| 158 | fi |
|---|
| 159 | |
|---|
| 160 | staged-install-raster: |
|---|
| 161 | @if test x"@RASTER@" != "x"; then \ |
|---|
| 162 | $(MAKE) -C ../raster/rt_pg REGRESS=1 DESTDIR=$(REGRESS_INSTALLDIR) install; \ |
|---|
| 163 | fi |
|---|
| 164 | |
|---|
| 165 | staged-install: staged-install-raster staged-install-topology |
|---|
| 166 | $(MAKE) -C ../postgis REGRESS=1 DESTDIR=$(REGRESS_INSTALLDIR) install |
|---|
| 167 | $(MAKE) -C ../ REGRESS=1 DESTDIR=$(REGRESS_INSTALLDIR) comments-install |
|---|
| 168 | $(PERL) -pi.bak -e 's,\$$libdir,$(REGRESS_INSTALLDIR)/lib,g' $(REGRESS_INSTALLDIR)/share/contrib/postgis/*.sql |
|---|
| 169 | #$(MAKE) -C ../loader REGRESS=1 DESTDIR=$(REGRESS_INSTALLDIR) install |
|---|
| 170 | |
|---|
| 171 | test check: staged-install |
|---|
| 172 | ./run_test $(RUNTESTFLAGS) $(TESTS) && \ |
|---|
| 173 | ./run_test --upgrade $(RUNTESTFLAGS) $(TESTS) |
|---|
| 174 | |
|---|
| 175 | garden: |
|---|
| 176 | createdb postgis_garden |
|---|
| 177 | createlang plpgsql postgis_garden |
|---|
| 178 | psql -d postgis_garden < ../postgis/postgis.sql |
|---|
| 179 | psql -d postgis_garden < ../spatial_ref_sys.sql |
|---|
| 180 | @echo '-------------------------------------------------' |
|---|
| 181 | @echo 'Regression tests in progress (it will take time)' |
|---|
| 182 | @echo 'Result output: ./regress/garden_result.txt' |
|---|
| 183 | @echo '-------------------------------------------------' |
|---|
| 184 | psql -d postgis_garden < ../doc/postgis_gardentest_${POSTGIS_MAJOR_VERSION}${POSTGIS_MINOR_VERSION}.sql > postgis_garden_result.txt 2>&1 |
|---|
| 185 | #dropdb postgis_garden |
|---|
| 186 | |
|---|
| 187 | cleanup: |
|---|
| 188 | @sleep 1 |
|---|
| 189 | @dropdb postgis_reg > /dev/null |
|---|
| 190 | |
|---|
| 191 | clean: |
|---|
| 192 | rm -rf $(REGRESS_INSTALLDIR) |
|---|