KUnitTest progress

Frans Englich frans.englich at telia.com
Thu Apr 14 02:18:00 BST 2005


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.

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

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.


Cheers,

		Frans




More information about the kde-core-devel mailing list