[GRASS-dev] unit tests?

Hi all,

I'd like to do some further enhancements of i.segment (GSOC 2012
project, will hopefully send an official announcement soon!), and have
a chance to use it for a class homework project... if I include some
unit tests of the results. I've previously used junit/Netbeans. For
GRASS development, I've been using Geany, and just kept a text file
with commands to run after making changes.

Does anyone run unit tests on individual modules, or have any advice
on an easy way to set something up? I read a little bit about cunit,
but it was already taking longer than junit/Netbeans. I just need to
decide if it will be easy enough to add some unit testing, or if I'd
be better doing something else for class and using the time learned to
do c unit testing on more development on i.segment :slight_smile:

Thanks,
Eric

On 17/10/12 16:58, Eric Momsen wrote:

Hi all,

I'd like to do some further enhancements of i.segment (GSOC 2012
project, will hopefully send an official announcement soon!), and have
a chance to use it for a class homework project... if I include some
unit tests of the results. I've previously used junit/Netbeans. For
GRASS development, I've been using Geany, and just kept a text file
with commands to run after making changes.

Does anyone run unit tests on individual modules, or have any advice
on an easy way to set something up? I read a little bit about cunit,
but it was already taking longer than junit/Netbeans. I just need to
decide if it will be easy enough to add some unit testing, or if I'd
be better doing something else for class and using the time learned to
do c unit testing on more development on i.segment :slight_smile:

It's been an on and off effort in GRASS, but check here for more info: http://grass.osgeo.org/wiki/Test_Suite

Moritz

On Wed, Oct 17, 2012 at 5:06 PM, Moritz Lennert
<mlennert@club.worldonline.be> wrote:

On 17/10/12 16:58, Eric Momsen wrote:

Hi all,

I'd like to do some further enhancements of i.segment (GSOC 2012
project, will hopefully send an official announcement soon!), and have
a chance to use it for a class homework project... if I include some
unit tests of the results. I've previously used junit/Netbeans. For
GRASS development, I've been using Geany, and just kept a text file
with commands to run after making changes.

Does anyone run unit tests on individual modules, or have any advice
on an easy way to set something up? I read a little bit about cunit,
but it was already taking longer than junit/Netbeans. I just need to
decide if it will be easy enough to add some unit testing, or if I'd
be better doing something else for class and using the time learned to
do c unit testing on more development on i.segment :slight_smile:

It's been an on and off effort in GRASS, but check here for more info:
http://grass.osgeo.org/wiki/Test_Suite

While a testsuite is there for a series of commands (I am happy
to contribute more, e.g. by using the examples from the manual
pages), I fail to activate them:

[neteler@oboe v.unpack]$ pwd
/home/neteler/grass70/scripts/v.unpack

[neteler@oboe v.unpack]$ ls -la test_suite/
total 4
-rwxr-xr-x. 1 neteler gis 2180 Nov 10 2012 test.v.unpack.sh*

[neteler@oboe v.unpack]$ make tests
make: *** No rule to make target `tests'. Stop.
[neteler@oboe v.unpack]$ make test
make: *** No rule to make target `test'. Stop.

Am I right that a "test" target is still lacking and the hints on above
Wiki page are rather ideas?

It would be important to have a "make test" target in the Makefile
system, perhaps by moving the private one of
lib/vector/diglib/Makefile
to the main Makefile system of GRASS 7?

Markus

I ended up using local scripts for the class project. I also have the impression that the wiki for the Test_Suite was planning ideas.

-Eric

···

On Sat, Jun 15, 2013 at 3:43 AM, Markus Neteler <neteler@osgeo.org> wrote:

On Wed, Oct 17, 2012 at 5:06 PM, Moritz Lennert
<mlennert@club.worldonline.be> wrote:

On 17/10/12 16:58, Eric Momsen wrote:

Hi all,

I’d like to do some further enhancements of i.segment (GSOC 2012
project, will hopefully send an official announcement soon!), and have
a chance to use it for a class homework project… if I include some
unit tests of the results. I’ve previously used junit/Netbeans. For
GRASS development, I’ve been using Geany, and just kept a text file
with commands to run after making changes.

Does anyone run unit tests on individual modules, or have any advice
on an easy way to set something up? I read a little bit about cunit,
but it was already taking longer than junit/Netbeans. I just need to
decide if it will be easy enough to add some unit testing, or if I’d
be better doing something else for class and using the time learned to
do c unit testing on more development on i.segment :slight_smile:

It’s been an on and off effort in GRASS, but check here for more info:
http://grass.osgeo.org/wiki/Test_Suite

While a testsuite is there for a series of commands (I am happy
to contribute more, e.g. by using the examples from the manual
pages), I fail to activate them:

[neteler@oboe v.unpack]$ pwd
/home/neteler/grass70/scripts/v.unpack

[neteler@oboe v.unpack]$ ls -la test_suite/
total 4
-rwxr-xr-x. 1 neteler gis 2180 Nov 10 2012 test.v.unpack.sh*

[neteler@oboe v.unpack]$ make tests
make: *** No rule to make target tests'. Stop. [neteler@oboe v.unpack]$ make test make: *** No rule to make target test’. Stop.

Am I right that a “test” target is still lacking and the hints on above
Wiki page are rather ideas?

It would be important to have a “make test” target in the Makefile
system, perhaps by moving the private one of
lib/vector/diglib/Makefile
to the main Makefile system of GRASS 7?

Markus