[GRASS-dev] Testing framework now in trunk
wenzeslaus at gmail.com
Wed Jul 9 21:02:07 PDT 2014
I moved testing framework (gunittest package) from sandbox to trunk in
r61225 [1, 2].
You can run all tests from GRASS source code top directory using:
python -m grass.gunittest.main .../grassdata/ nc_spm_08 nc
You should be in GRASS session and in some testing location (it will not be
used but to be sure that nothing is damaged). First parameter is path to
GISDBASE, second is the name of location (you should use sample NC smp
location) and third parameter should be 'nc'. Running tests may take few
minutes and then open a file testreport/index.html with test results.
I'm working on 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 t.rast.extract,
r.gwflow, g.mlist, g.mremove, g.list, and r.slope.aspect.
You can write tests for raster modules pretty easily and in limited way it
is possible to write tests for vector modules too. See the available assert
methods [4, 5]. When writing consider that you are sample NC spm location.
Tests for modules such as r.info or r.univar are good starting point in
learning how to write tests and moreover, it would be advantageous to have
these core modules covered. If you would prefer rewriting rather then
writing, there is a lot of tests (or Pythod doctests) here and there which
might be integrated into the new framework. I can give you some pointers.
I'm getting feedback from Soeren but I would like to hear from other
developers, too. So, let me know what you think.
(rendered by Trac see Sphinx doc for full documentation)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the grass-dev