rfc 12: C code Unit tests

Umberto Nicoletti umberto.nicoletti at GMAIL.COM
Tue Mar 7 06:54:47 EST 2006

Hi Frank,
comments inline.

On 3/3/06, Frank Warmerdam <warmerdam at pobox.com> wrote:
> Umberto Nicoletti wrote:
> > I have rewritten rfc12.
> > I await your comments on it.
> >
> > http://mapserver.gis.umn.edu/development/rfc/ms-rfc-12
> Umberto,
> You write:
> "When cunit is a vailable unit tests could be run by default at the end
> of the compile phase: "
> I think instead there ought to be a "make test" target.  In particular,
> I do not want my normal development sequence interrupted by tests running.
> Instead I would prefer to do this sort of testing before doing a CVS
> commit.

That depends on how much time tests take to run, but in general I am
not opposed to your proposal. Let's hear what others have to say about

> You write:
> "The patch was created in under 6 hours by a single person,
> who is not a frequent C programmer. This is meant to prove that unit
> tests do not take away much time from developers and that in general
> the benefit is worth the cost."
> I'm not sure that your creating the patch in under six hours really
> proves the point you suggest.  Overall this part left me wondering
> if you appreciate the development issues of core C programmers on
> mapserver and whether you are "in it for the long haul" in terms of
> being the advocate of the C unit tests.

I meant that as an answer to the argument that writing unit tests
steals precious time from programmers.

As of my commitment I cannot make promises: as most of you I do this
in my spare time and I cannot make guarantees that I will be working
on mapserver and/or unit tests for any amount of time in the future,
but I will try as hard as possible to keep up with my duties as a
mapserver developer.

> You write:
> "Effort should be put toward developing a build system capable of
>     1. testing the overall build/test of mapserver and of the various
>        mapscripts with different configure options
>     2. and integrating those results with the msautotest suite."
> I'm not sure I follow what you mean here.  Is (1) about having a
> build-and-smoke-test system setup somewhere that automatically builds
> MapServer is a variety of configurations and runs tests nightly or
> more often?  And what does "integrating those results with the msautotest
> suite" mean?
> I think perhaps this section should be left out of the RFC, and
> addressed as a separate initiative.

Agreed, I only wanted to explain how unit tests would fit in a future
to-be-created build tool used to  automatically assess the wellness of
the mapserver source. Kind of big picture.

The integration of msautotest and this yet-to-be-named-tool simply
means that they should be run together and statistics 
(errors/failures, ecc) collected from both of them for display on the
mapserver web site.

> Lastly, I hope you would commit to writing a README for the
> unit test directory, or a page for the web site, which introduces
> the specifics of how to add new tests.  Perhaps this is already
> addressed in bug report.

'Course I do.

Best regards,

> Overall I am "+0" on your initiative.  If/when it is in place, I will
> run the tests and attempt to extend them as time permits and it seems
> appropriate.
> I am also keen on the build-and-smoke-test server and would hope this
> could be setup on OSGeo hardware that all core developers can be
> given access to.  I would hope it could also be used for other
> foundation projects.
> Best regards,
> --
> ---------------------------------------+--------------------------------------
> I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam
> and watch the world go round - Rush    | President OSGF, http://osgeo.org

More information about the mapserver-dev mailing list