[RFC] KUnitTest library
David Faure
faure at kde.org
Thu Apr 7 14:20:49 BST 2005
On Thursday 07 April 2005 14:57, Jeroen Wijnhout wrote:
> On Thursday 07 April 2005 01:56 pm, David Faure wrote:
> > > I don't think it's weak compared to other tools, in fact I think it
> > > stacks rather well against them. Personally I was just never too happy
> > > with it. It doesn't make it bad by any means, it just makes it one of
> > > the billion things that I wrote and was never fully happy with :)
> > > I'm sure you made it substantially better and if you think you'll be
> > > able to maintain it, I'd say go for it (put it in kdesdk, or maybe even
> > > kdelibs). It would definitely make a lot of sense to have a unit
> > > testing library in KDE at some point.
> >
> > Yes I would really like to have some unit test framework in kdelibs so that
> > the unit tests there can all use the same framework.
> >
> > I haven't tested KUnitTest, but if the lib can be separated from the GUI,
> > then let's have the lib in kdelibs and the gui in kdesdk. Would be nice to
> > have a non-gui mode for "make check" though.
>
> It is not a problem at all to separate the two. Currently there are two
> test-runner classes: KUnitTest::Runner and KUnitTest::RunnerGUI. The Runner
> class is non-gui and all you need to run and review tests, therefore suitable
> to use in "make check".
OK. Please note that for this to work properly, the test code must be
compiled as a dynamically-loadable module, and the executable from kdesdk
must open it and run the tests inside.
BTW KDAB's KDUnit does all this already, and Kalle gave me the OK
for LGPL-ing its lib (and GPL-ing the test program). But I had a closer look now,
and since it's all pure Qt, it needs to be ported to KLibLoader, Makefile.am,
KDE icon loading, etc. Not sure this would be the fastest way out. But I will
look at extending the assertion mechanism of KUnitTest to match KDUnit's
(assertTrue(), assertNotNull(), assertEquals() etc. with some template magic
for printing out the expected and actual values)
--
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
More information about the kde-core-devel
mailing list