kde unittests integrated in cmake buildsystem

Alexander Neundorf neundorf at kde.org
Sun Feb 5 19:26:10 CET 2006


Hi,

this afternoon I integrated the unittests in kdelibs/kdecore/tests/ into the 
cmake buildsystem.
Here you can see the results:

http://public.kitware.com/KDE/Testing/Dashboard/20060205-0100-Nightly/Dashboard.html
(clicking on the test results of "hammer"):
http://public.kitware.com/KDE/Testing/Sites/hammer/Linux-c++/20060205-1628-Experimental/Test.html

The tests are executed when you "make test" or "make Experimental". The second 
option includes submitting the results to the dashboard.

What did it take to integrate these tests in the buildsystem ?

-insert the enable_testing() command in the toplevel CMakeLists.txt

-insert an option so you can decide whether you want to build kdelibs with or 
without tests in KDE4Macros.cmake:
option(KDE4_BUILD_TESTS  "Build the tests")  # defaults to off

-add the rules for building the unittest executables, guarded by if 
(KDE4_BUILD_TESTS) , this was done automatically by the am2cmake script

-now the step I took today: insert 
add_test( <name_of_the_test> <executable> <optional_args...>)
for all tests you want to run

-and finally: turn the option KDE4_BUILD_TESTS on e.g. using ccmake and run 
"make Experimental"

I didn't add the add_test() for all unittests yet, there are quite many. I 
excluded the tests which create a KApplication object, since these failed 
with some dcop error. I also excluded the tests which required user 
intervention (e.g. kxerrorhandlertest).

Bye
Alex
-- 
Work: alexander.neundorf AT jenoptik.com - http://www.jenoptik-los.de
Home: neundorf AT kde.org                - http://www.kde.org
      alex AT neundorf.net               - http://www.neundorf.net


More information about the Kde-buildsystem mailing list