[Proj] Testing framework

Even Rouault even.rouault at spatialys.com
Tue May 29 12:15:14 EST 2018


I was researching a framework to test my new code (and that could also be used 
to test the existing C API if needed). Currently src/gie.c has ad-hoc testing, 
but it is really limited feature-wise: no nice error message (returns error 
code), no way to make a testcase go on even if a test check fails, etc...

So a dedicated framework seems a better idea, and I've found catch2 :

One of its main feature it is a header only testing framework, which means we 
can embed it easily in proj source tree, which is practical compared to other 
frameworks I've considered ( googletest, cppunit,  etc... ).
The tut framework used by GDAL and GEOS
( http://mrzechonek.github.io/tut-framework ) would also enter this category 
of header(s) only, but it has not as much as activity than catch2.
There's also Boost.Test, but I was a bit afraid with the boost name in it 
(although apparently it has a standalone mode).

Example of tests I've just written with catch2 (just a minimalistic use of the 
testing framework)

I'm not particularly calling for a flame debate on the suject, just wanting to 
mention this finding.


Spatialys - Geospatial professional services

More information about the Proj mailing list