[postgis-users] Unit testing a PostGIS function

Adrien ANDRÉ adr.andre at laposte.net
Thu Dec 3 07:25:49 PST 2015


Hi all,

for simple code, appart from the main project, how may i perform unit 
testing?


Looking at the source code structure [1], i wrote a simple function, 
some queries using it and produced expected outputs to the following files:
.
├── function.sql
└── regress
     ├── function_expected
     └── function.sql

Not at ease with complex makefiles and not knowing the Perl language, i 
simply tried comparing
psql -t -A -f regress/function.sql -o function_output
with
function_expected
using diff...

Is there a better way?


Thank you for any suggestion,

kind regards,

Adrien


[1] https://trac.osgeo.org/postgis/browser/trunk/regress


More information about the postgis-users mailing list