Changes between Version 45 and Version 46 of GSoC/2014/TestingFrameworkForGRASS


Ignore:
Timestamp:
Jul 14, 2014, 7:21:38 AM (10 years ago)
Author:
wenzeslaus
Comment:

add Testing framework now in trunk announcement

Legend:

Unmodified
Added
Removed
Modified
  • GSoC/2014/TestingFrameworkForGRASS

    v45 v46  
    637637[source:sandbox/wenzeslaus/gunittest/testing.rst?rev=61144 documentation], [http://lists.osgeo.org/pipermail/grass-dev/2014-July/069923.html report email]
    638638
     639=== Announcement: Testing framework now in trunk ===
     640
     641I moved testing framework ([source:grass/trunk/lib/python/gunittest?rev=61225 gunittest] package) from sandbox to trunk in
     642r61225.
     643
     644You can run all tests from GRASS source code top directory using:
     645
     646{{{
     647python -m grass.gunittest.main .../grassdata/ nc_spm_08 nc
     648}}}
     649
     650You should be in GRASS session and in some testing location (it will not be
     651used but to be sure that nothing is damaged). First parameter is path to
     652GISDBASE, second is the name of location (you should use sample NC smp
     653location) and third parameter should be 'nc'. Running tests may take few
     654minutes and then open a file `testreport/index.html` with test results.
     655
     656I'm working on [source:grass/trunk/lib/python/docs/src/gunittest_testing.rst?rev=61228 documentation] but assertion methods are well documented already and there is already a lot of examples in the source code. See directories named testsuite for example test files (ignore testsuite directory in root for now). Modules which have tests are [source:grass/trunk/temporal/t.rast.extract/testsuite t.rast.extract], [source:grass/trunk/raster/r.gwflow/testsuite r.gwflow], [source:grass/trunk/general/g.mlist/testsuite g.mlist], [source:grass/trunk/general/g.mremove/testsuite g.mremove], [source:grass/trunk/general/g.list/testsuite g.list], and [source:grass/trunk/raster/r.slope.aspect/testsuite r.slope.aspect].
     657
     658You can write tests for raster modules pretty easily and in limited way it
     659is possible to write tests for vector modules too. See the available assert
     660methods (in [source:grass/trunk/lib/python/gunittest/case.py?rev=61225 gunittest] and in [https://docs.python.org/2/library/unittest.html#assert-methods unittest]). When writing consider that you are in GRASS sample NC spm location.
     661
     662Tests for modules such as `r.info` or `r.univar` are good starting point in
     663learning how to write tests and moreover, it would be advantageous to have
     664these core modules covered. If you would prefer rewriting rather then
     665writing, there is a lot of tests (or Pythod doctests) here and there which
     666might be integrated into the new framework. I can give you some pointers.
     667
     668I'm getting feedback from Soeren but I would like to hear from other
     669developers, too. So, let me know what you think.
     670
     671[http://lists.osgeo.org/pipermail/grass-dev/2014-July/069988.html announcement email]
    639672=== Week 08 ===
    640673