[cmake-developers] Testing Groups

Andreas Schneider asn at cryptomilk.org
Mon Jun 10 03:19:15 EDT 2013


Hi,

I'm currently working on some libraries [1] which allows you advanced testing 
of daemons. Especially ones which require a network in testing. However for 
using this I need some features in CMake. This should be a discussion about 
these features. Maybe others have ideas and comments.

What I would like to have is a feature to group tests. By default everything 
is in a standard test group. But you can define a special one:

add_test(NAME <name> [CONFIGURATIONS [Debug|Release|...]]
         [GROUP <test_group>]
         [WORKING_DIRECTORY dir]
         COMMAND <command> [arg1 [arg2 ...]])


For a test group I need a way to define a setup/teardown command. Some tests 
might require a special setup on the machine to be able to run correctly. Like 
setting up a fake network.

set_test_group_properties(PROPERTIES
    SETUP <command> [arg1 [arg2 ...]]
    TEARDOWN <command> [arg1 [arg2 ...]]
    ENVIRONMENT <env>)

The setup function is called before the first test of the group is executed 
and the teardown functions after the last test finished. The environment 
should be obvious.


Please comment.


	-- andreas



[1] http://git.cryptomilk.org/projects/socket_wrapper.git/

-- 
Andreas Schneider                   GPG-ID: F33E3FC6
www.cryptomilk.org                asn at cryptomilk.org




More information about the cmake-developers mailing list