<div dir="ltr"><div>It was not required by GSoC but I wanted to do some final report to summarize what was done and what could be done in the future. So, here is a shorter version of the report, the full is on Trac.<br><br>Ways to run tests:<br> * each file separately in the current location and mapset you are in<br>  * good for testing the code you are just writing<br>  * good for writing the test<br> * running all tests in subdirectories<br>  * generates a report<br>  * switches to specified location and mapset<br>  * generates detailed report<br> * using higher level script to run tests from outside GRASS session<br><br>How to write tests:<br> * using GRASS Python package `gunittest`<br>  * works in the same way as `unittest`<br>  * adds GRASS-specific functionality<br>  * allows generation of HTML reports<br>  * enables fine control over execution of GRASS modules<br>  * this is the preferred way, other ways such Shell scripts are discouraged<br><br>When writing tests, `gunittest` package allows in a convenient way to:<br> * compare map statistics or info to a given reference<br> * compare raster and 3D raster maps with each other<br> * compare vector maps using different ways<br> * compare numbers and texts<br><br>Things which should be solved in the short term:<br> * tests should specify the location they can run in<br> * encapsulate removal of maps and other files<br> * test tests on more platforms<br><br>Long-term plans:<br> * integrate tools such as `valgrind`<br> * provide coverage<br> * introduce static test of source code<br></div><div> * time execution of modules<br></div><div><br>It is probably good to mention that documentation with examples is in Python API Sphinx documentation. You can get it by `make sphinxdoc`.<br><br>And there is probably no need to mention that although there is a lot of tests which can serve you as examples there is not enough tests to cover all GRASS functionality, so please contribute.<br><br>Thanks to the test, we have already discovered several bugs soon after they were introduced (the day of after the commit). This is very encouraging to me and I hope also to others.<br><br></div><div>If you have some feedback or problems with writing tests, please share.<br></div><div><br></div>Vaclav<br><br><a href="http://trac.osgeo.org/grass/wiki/GSoC/2014/TestingFrameworkForGRASS#Finalreport">http://trac.osgeo.org/grass/wiki/GSoC/2014/TestingFrameworkForGRASS#Finalreport</a><br></div>