[RFC] Split tests and examples in KDE4

Frans Englich englich at kde.org
Sun Jul 9 13:44:50 BST 2006

On Sunday 09 July 2006 12:16, Brad Hards wrote:
> G'day,
> Currently we have a mixture of automatic tests (using QTestLib), and
> non-automated tests/examples in kdelibs. Mostly, they are in /tests
> subdirectories.
> Those are mostly [1] built when you use enable the KDE4_BUILD_TEST option
> to cmake.
> The examples would then be linked into the apidox.

Yes, thank you for suggesting this. I already do this for Patternist, 
kdenonbeta/kdom/patternist, and it really make the Doxygen easier to 
maintainer since one can actually verify that code examples doesn't contain 
errors, and the doxygen is easier to edit(since the code listings are out of 
the way).

However, often it isn't as simple as moving the code listing out to a file. 
Most code examples are 5-6 lines taken directly from a function body. If that 
is put in a compilation unit, you'll miss header inclusions and typically a 
wrapping function definition, and usually one doesn't want that in the code 

I solve that by having a central cpp file from which I include other cpp files 
which are the actual examples, or I use Doxygen's @skip/@until commands(a bit 
cumbersome, but it works). Perhaps something like that is applicable in this 



More information about the kde-core-devel mailing list