[bind10-dev] C++ unit test tool?
JINMEI Tatuya / 神明達哉
jinmei at isc.org
Sat Oct 17 01:01:00 UTC 2009
One open issue on development is about testing.
As an experiment I've written some simple test cases for the DNS Name
class using CppUnit (http://sourceforge.net/apps/mediawiki/cppunit/)
It's already been committed to the svn repository, so you can try it
if you have cppunit in your system. The test code should be easily
understood (I believe):
http://bind10.isc.org/browser/trunk/src/lib/dns/name_unittest.cc
I've never used this tool, but it was pretty easy to understand how to
use it: I've read a tutorial
http://cppunit.sourceforge.net/doc/1.11.6/cppunit_cookbook.html
written test code, made it compile and runnable, added necessary
autoconf knobs within a single day. And, in this very limited
experiment it seems to work reasonably.
Now I have questions:
is it a good idea to continue using this tool?
is there a better unit test tool for C++?
is there any license matter? (cppunit is released under the Lesser GPL)
BTW: BIND9 has an in-house test framework. We could reuse it, but I
personally don't think it makes much sense because:
- we'll need to modify the framework, perhaps pretty much, anyway,
because it highly depends on other BIND9's internal library. It
also (obviously) doesn't support C++ specific features such as
exceptions.
- we'd expect external developers will touch the test suites. So it's
better to keep introduction barrier (wrt learning how to use it) as
low as possible. In this sense, another problem of BIND9's in-house
test framework is that there's almost no document about it.
Suggestions are highly appreciated, especially about alternative
tools.
---
JINMEI, Tatuya
More information about the bind10-dev
mailing list