KUnitTest progress

Jeroen Wijnhout Jeroen.Wijnhout at kdemail.net
Thu Apr 14 10:10:32 BST 2005


On Thursday 14 April 2005 03:18 am, Frans Englich wrote:
> On Wednesday 13 April 2005 13:31, Jeroen Wijnhout wrote:
> > Hi all,
> >
> > I've made some progress with the KUnitTest framework. It is now possible
> > to store unittests in dynamically loadable modules. A runner app (with or
> > without gui) is provided to load and run the modules. If the tests are
> > built into modules which are stored in kdelibs/unittests, then running
> > them is as simple as:
> > $kunittestmod.sh --folder kdelibs/unittests
> >
> > There is also a new class, KUnitTest::SlotTester, which is capable of
> > running any slots with type void test*().
> >
> > The GUI has improved a lot, but I'm not completely done.
> >
> > I would like to know whether or not this framework will be usable for
> > people.
>
> It would be useful for me; I have a couple of hundred of tests in KDOM I'd
> like to convert to something good and standardized(and which I likely
> will). It looks very nice, especially the accompanying docs.

Thanks.

> Is it possible to check for thrown exceptions? Is it something you plan to
> add?

No, not really. How is this supposed to work (from the perspective of the user 
of the library)?

> To my experience, it is not very C++-ish to communicate different errors
> through an exception class hierarchy, but it would nevertheless be useful
> to test whether an interface throws an exception or not. Perhaps it's
> doable with macro magic, as well as detecting whether the exception is on
> the heap or stack, and needs deletion..
>
> Another question: is it possible to document tests inline? IMO & FWIW,
> tests tend to become obscene, and to make clear what they test, their
> essence, is essential to make use of them. I would even go so far and
> suggest that the GUI could issue a warning(in a console or similar) if a
> test without documentation is encountered, and have a tool tip explain the
> importance of documentation such that the user feels motivated. For the
> reason of helping the programmer towards good habits.

What's wrong with comments in the code? Or do you want to be able to view the 
documentation in the GUI? That would be neat of course, but I'm not sure if 
it is worth the effort since double-clicking on a failed test in the details 
widget (the bottom one) will take you to the corresponding code in KDevelop 
(if you have a KDevelop application running) anyway.

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




More information about the kde-core-devel mailing list