[Qgis-developer] Python tests and C++ tests for the same functionality

Nyall Dawson nyall.dawson at gmail.com
Sat Nov 8 11:23:48 PST 2014


On 9 November 2014 00:30, Matthias Kuhn <matthias.kuhn at gmx.ch> wrote:
>
> (1) We could accept these deviations with anomalies or multiple
> reference images.
>
> (2) Or we could remove the C++ test in favor of the python test which
> will test the same functionality/codepath and the python binding in
> addition. That would have the advantage that maintainability will be
> easier, because not every of these tests needs to be written and
> adjusted twice. The only disatvantage I can see is that you then don't
> know if it's the python binding or the logic behind it that made a test
> fail. But that shouldn't make a big difference in the time one needs to
> debug a test.

My reservation with switching solely to the python tests is that it
makes debugging a lot more difficult. With c++ tests it's easy to run
a test from a debug session in qt creator to help track down a bug.
The workflow for python tests is a lot more difficult... (or is there
a way I'm missing of running these tests through qt creator too?).

For this reason, I'd vote for c++ tests for most methods and python
tests only when anything fancy is done is the sip bindings (transfer
of ownership, etc).

Nyall


More information about the Qgis-developer mailing list