Automatic coverage testing of mapserv?

Petter Reinholdtsen pere at HUNGRY.COM
Sat Feb 5 17:20:31 EST 2005


[Frank Warmerdam]
> In addition to Sean's mapscript based unit test,

Where is this?  Are you talking about the stuff in mapserver/tests/?

> I also maintain a test suite that can be run automatically.  They
> can be checked out of CVS as "msautotest".  There is a topic in the
> wiki that discusses the msautotest series.

This look like a very good starting point.  I'm investigating it now.
One thing that surprised me was the fact that you seem to be using a
home made test suite system instead of using the official one included
in python.  Why is this?  Unless you have a very good reason, I
suggest we rewrite it to use the unittest python module,
<URL:http://docs.python.org/lib/module-unittest.html>.  This will give
us the system to run all tests at once and give a summary at the end
of all these tests.

> Rather than starting yet another completely different test methology
> I would encourage you to look at adding into msauotest.  I'm sure a
> "mapserv QUERY_STRING=... " style test would fit into it quite
> naturally, and I would be willing to cooperate on it.

Yes, this look like a better starting point that the mapserver/tests/
scripts, and I will start here.  I'll start by trying to understand
the current tests, and see how much code coverage they provide.

This patch will make it easier to enable coverage testing using a new
--enable-coverage configure flag.

Index: configure.in
===================================================================
RCS file: /data2/cvsroot/mapserver/configure.in,v
retrieving revision 1.117
diff -u -3 -p -u -r1.117 configure.in
--- configure.in        28 Jan 2005 07:13:24 -0000      1.117
+++ configure.in        5 Feb 2005 22:14:24 -0000
@@ -1773,6 +1773,10 @@ fi
 AC_SUBST(DEBUG_FLAGS, $DEBUG_FLAGS)
 ALL_ENABLED="$DEBUG_FLAGS $ALL_ENABLED"

+AC_ARG_ENABLE(coverage,
+[  --enable-coverage       Enable coverage testing],
+[CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"])
+
 dnl ---------------------------------------------------------------------
 dnl PHP/MapScript module options
 dnl ---------------------------------------------------------------------



More information about the mapserver-dev mailing list