[Qgis-developer] Python unit testing for QGIS
Tim Sutton
lists at linfiniti.com
Wed Jul 25 13:55:24 PDT 2012
Hi
On Mon, Jul 23, 2012 at 3:52 PM, Sandro Santilli <strk at keybit.net> wrote:
> On Mon, Jul 23, 2012 at 12:26:00AM +0200, Tim Sutton wrote:
>> Hi Folks
>>
>> Yes I know I am becoming something of a unit testing freak, but I am
>> 10 000% convinced we really need to get a good test suite if we plan
>> to be a viable option for 'enterprise adoption' and generally not
>> wasting time trying to figure out what works and what doesnt.
>>
>> Anyway, I have added the capability to add python tests to the CTest
>> suite (you know when you run make test / check / Experiemental).
>>
>> I think building a python test suite is a no-brainer - it is where the
>> largest amount of developer activity happens and we should always know
>> that third party tools are working.
>>
>> The nice thing is that you now don't need to be a C++ guru to write
>> tests. I am going to write proper detailed documentation on how to add
>> a new python test, but early adopters can check out the sample I added
>> here:
>>
>> https://github.com/qgis/Quantum-GIS/commit/b702d3ca9f1e577c1efd57decab972300de3b085#L4L-1
>>
>> There are a few things that I would still like to resolve:
>>
>> * you probably will need to set QGISPATH env var to match your CMake
>> install prefix
>> * you will probably need to set you LD_LIBRARY_PATH to your qgis libs dir
>> * currently I don't have 'in build dir' testing working
>
> I think these later three obstacles will be important to remove.
> Running tests should be as easy as typing "make check".
>
> Encode the LD_LIBRARY_PATH and QGSISPATH settings in a shell script
> invoked by "make check" maybe ? But do I understand correctly those
> two are not enough for "in build dir" testing ? Does that mean you
> need to install before running tests ?
>
Júrgen kindly fixed these two issues now, so it is a no brainer for
all devs to start adding tests for their python bindings now!
Regards
Tim
> Great work, btw :)
>
> --strk;
>
> ,------o-.
> | __/ | Delivering high quality PostGIS 2.1
> | / 2.1 | http://strk.keybit.net - http://vizzuality.com
> `-o------'
>
--
Tim Sutton - QGIS Project Steering Committee Member (Release Manager)
==============================================
Please do not email me off-list with technical
support questions. Using the lists will gain
more exposure for your issues and the knowledge
surrounding your issue will be shared with all.
Visit http://linfiniti.com to find out about:
* QGIS programming and support services
* Mapserver and PostGIS based hosting plans
* FOSS Consulting Services
Skype: timlinux
Irc: timlinux on #qgis at freenode.net
==============================================
More information about the Qgis-developer
mailing list