[Qgis-developer] Python unit testing for QGIS

Sandro Santilli strk at keybit.net
Mon Jul 23 06:52:50 PDT 2012


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 ? 

Great work, btw :)

--strk; 

  ,------o-. 
  |   __/  |    Delivering high quality PostGIS 2.1
  |  / 2.1 |    http://strk.keybit.net - http://vizzuality.com
  `-o------'



More information about the Qgis-developer mailing list