Question about unittesting

Kevin Krammer krammer at
Sun Apr 8 21:39:55 BST 2012

Hi Giorgos,

On Sunday, 2012-04-08, Giorgos Tsiapaliwkas wrote:
> Hello,
> Why we don't have in KDE a macro like,
> if (application_is_in_debug_mode) {
> //do some testing
> }

How would a macro make things different?
Something like
  // do some testing

so the developer does not have to remember how to check a command line 
argument's value?

> Why we need a macro like that?
> a. Giorgos added a feature which deletes a folder from dolphin. Without
> this  macro in order Giorgos to
> test it he needs,
> -to create a dir
> -remove the dir
> -check if the remove was successful(this is the actual test)
> but if we had this macro Giorgos would need to implement the last step.

I am probably misunderstanding your use case, but how would only the last step 
necessary? I.e. how would a generic macro know that it has to create and 
remove a directory?

At KDE we usually use the QTest framework [1] for unittesting and we have 
cmake macros that make it easy to add them to a project's CMakeLists.txt (e.f. 
see [2]) and some C/C++ helper macros that make writing them easier [3].


Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <>

More information about the kde-core-devel mailing list