[Proj] Testing framework

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


Hi,

(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:

Hi,

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 :
        https://github.com/catchorg/Catch2/blob/master/docs/Readme.md

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)
https://github.com/rouault/proj.4/blob/iso19111_ptr/test/cpp/test_crs.cpp

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


Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
Proj mailing list
Proj at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/proj
-------------- 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