[RFC] KUnitTest library

Jeroen Wijnhout Jeroen.Wijnhout at kdemail.net
Thu Apr 7 10:47:43 BST 2005


On Thursday 07 April 2005 10:22 am, Zack Rusin wrote:
> On Thursday 07 April 2005 03:33, Jeroen Wijnhout wrote:
> > Hi all,
> >
> > The last couple of days I've been working on a GUI for the KUnitTest
> > framework in kdenonbeta/kunittest. In doing so I modified the
> > original framework in such a way that it is even easier to use than
> > it was (imho). All of the unittesting facilities are put in a shared
> > library you can link to, so that adding new tests is really easy.
>
> heh, everyone seems to be saying that but when I was writing kunittest I
> never made a shared lib because I don't like that approach for unit
> tests. I don't like it because it increases the setup time. So it's a
> choice between code sharing and quick and dirt setup. For a shared lib
> you need a whole bunch of configure checks, if you just copy over

Configure checks? You install the lib once and add a -lkunittest to your 
linker flags. You don't want to enable the unittests in the distributed 
tarball anyway. If you look at the example you'll see that it is still easy 
to setup imho.

> whatever version of kunittest you want to be using, you're done. So
> that was also the reason for a minimal number of files and lack of a
> GUI - it wasn't making sense in such a small setup.

Personally I missed the GUI because I didn't see myself browsing through 
hundreds of lines of output. A GUI is very helpful here and improves 
productivity (read: _my_ productivity).

> I know that SourceXtreme has a project which was meant to replace
> kunittest but Ian would have to fill you in on how far is it.
> Personally I have two other versions of kunittest, one in pure c++
> which doesn't depend on Qt, and one for Qt4. But I have many doubts as
> to whether kunittest is the right approach. It does what it's supposed
> to and it does it well, that's for sure, but is it the best possible
> tool for the job? Probably not (it's just that all other solutions suck
> right now)

For me the advantage of KUnitTest is that is integrates well with the KDE 
build system, since I'm no automake hero, that's a real plus. I couldn't get 
the QtRunner of CppUnit to work (even when I got it to compile it crashed, 
while it didn't crash when it was compiled using the qmake .pro file). So 
KUnitTest is probably very weak compared to other tools, but he, it works ;-)

best,
Jeroen

-- 
Kile - an Integrated LaTeX Environment for KDE
http://kile.sourceforge.net




More information about the kde-core-devel mailing list