[Proj] Testing framework

Mateusz Loskot mateusz at loskot.net
Tue May 29 12:43:03 EST 2018


(sorry for top-posting, writing from rubbish mobile gmail)

As initial creator of GEOS tests who introduced TUT, I recommend to not to
use TUT. So, Even, good you don't.
It has been added ages ago when there where no decent lightweight testing
frameworks alternatives.

I use Boost.Test, Catch and Google Test, all have pros and cons, there's no
clear winner regarding features, IMHO.

Regarding Catch, I suggest to use Catch2, not 1.x line.

Mateusz Loskot, mateusz at loskot.net
(Sent from mobile)

On 29 May 2018 7:16 pm, "Even Rouault" <even.rouault at spatialys.com> wrote:


I was researching a framework to test my new code (and that could also be
to test the existing C API if needed). Currently src/gie.c has ad-hoc
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
can embed it easily in proj source tree, which is practical compared to
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
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
testing framework)

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


Spatialys - Geospatial professional services
Proj mailing list
Proj at lists.maptools.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/proj/attachments/20180529/39754395/attachment.htm 

More information about the Proj mailing list