| 1 | == Preparing PostgreSQL / PostGIS specific regress tests == |
| 2 | In addition to C-Unit tests, we also need a test that tests the function in the PostgreSQL environment. |
| 3 | These tests are kept in svn in the /regress folder. |
| 4 | |
| 5 | Basic steps: |
| 6 | * Create a .sql file listing key preferably corner cases of your function and name it some variant of your function name e.g myfunc.sql. Examples of these are in the /regress folder e.g. dumppoints.sql |
| 7 | * Run this sql file using psql and save the output in myfunc_expected. |
| 8 | * Add this .sql script to the Makefile.in in trunk/regress (NOTE: we can do this if you are submitting the patch). Also note that if your function relies on a particular version of GEOS that is not the minimum version for the PostGIS release, you need to wrap it in a conditional of the form: |
| 9 | |
| 10 | {{{ |
| 11 | ifeq ($(shell expr $(POSTGIS_GEOS_VERSION) ">=" 32),1) |
| 12 | TESTS += regress_buffer_params |
| 13 | endif |
| 14 | |
| 15 | }}} |