How to add a regression test ---------------------------- 1. Write a /regress/.sql file with data and sql queries for testing 2. Write a /regress/_expected or _expected.in file with expected results per query The expected results provided in the _expected file must be formatted using the following psql options: -a -- unaligned columns -f | -- use | (pipe) as the field separator between columns -t -- output rows only, ie. no table header cat file.sql | psql -F\| -t -A > file_expected 3. Edit regress/Makefile adding to the TESTS variable. Any _expected.in files need to be added to the PREPROC variable. Optional: If your test has unusual setup or teardown requirements, you may create any of the following optional files (they will run in this order): /regress/-pre.sh /regress/-pre.sql (run via psql) (The test itself is run here.) /regress/-post.sql (run via psql) /regress/-post.sh Notes about changes in regression tests introduces with PostGIS 1.1.0 --------------------------------------------------------------------- - Mixed-dimensioned geometries are no longer supported (previous behaviour was to fill Z with a 0 value) [ updated to use new behaviour ] - geometry_same operator (=~) now requires all dimensions equality Previously only x/y were checked - geometry_same operator (=~) now requires geom type equality Previous behaviour: GEOMETRYCOLLECTION(POINT(0 1), POINT(2 3)) =~ MULTIPOINT(0 1,2 3) - numb_sub_geometries does not exist anymore [updated to use numgeometries] - truly_inside does not exist anymore [updated to use within] Notes about _expected.in ---------------------------------- The first line of the _expected.in should include the postgis configuration header. #include "../postgis_config.h" The ability to run a c preprocessor over the expected results prior to regression testing was needed for testing curved string functionality that would elicit different responses from JTS vs GEOS compilations. Since JTS is no longer supported, this may not be required anymore.