[erlang-questions] Multiple common_test test case execution with different configs

Daniil Churikov ddosia@REDACTED
Wed Mar 20 20:20:21 CET 2013


I use common test framework to check some tricky scenarios.
Suppose that I wrote test case which intended to check user registration 
process:

    check_user_registration(Config) ->
        UserSpec = proplists:get_value(user, Config),
        ok = do_register(UserSpec).

UserSpec contains several fields(name, email, login, password etc.).
Now I want to check user registration with different UserSpecs, with long 
login,
with utf8 name or weak password.

The idea is to generate different Config variables with different 
combination
of such properties and somehow tell CT execute test case with those configs:

    all() -> [{check_user_registration, Config1}, ... 
{check_user_registration, ConfigN}].

But I cant figure out how to do this. My first approach was to use groups 
[1] for this.
They could be generated from Module:groups/0 [2] and allow dynamically
change number of testcases and/or groups to be executed. Still, their 
definition
contains order of execution and other useful properties, but not actual 
Config.

[1] 
http://www.erlang.org/doc/apps/common_test/write_test_chapter.html#id71944
[2] http://www.erlang.org/doc/man/common_test.html#Module:groups-0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130320/655b4619/attachment.htm>


More information about the erlang-questions mailing list