aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/src/ct_config.erl
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2010-06-03 14:34:09 +0200
committerRaimo Niskanen <[email protected]>2010-06-09 16:19:21 +0200
commit7c6504029f84c52de40a6b29b2fd1b17c053ccec (patch)
tree048864f9673af5757359e25a99b613c91253a4a1 /lib/common_test/src/ct_config.erl
parent4da38a84f7540856fa590afdba2eb7958978788c (diff)
downloadotp-7c6504029f84c52de40a6b29b2fd1b17c053ccec.tar.gz
otp-7c6504029f84c52de40a6b29b2fd1b17c053ccec.tar.bz2
otp-7c6504029f84c52de40a6b29b2fd1b17c053ccec.zip
Add event_handler_init start flag that can pass init arguments to event handlers
Also changed: The userconfig option in ct:run_test/1 from 3-tuple to 2-tuple.
Diffstat (limited to 'lib/common_test/src/ct_config.erl')
-rw-r--r--lib/common_test/src/ct_config.erl21
1 files changed, 14 insertions, 7 deletions
diff --git a/lib/common_test/src/ct_config.erl b/lib/common_test/src/ct_config.erl
index ee84164ad7..a7b8a9e906 100644
--- a/lib/common_test/src/ct_config.erl
+++ b/lib/common_test/src/ct_config.erl
@@ -181,15 +181,22 @@ process_default_configs(Opts) ->
process_user_configs(Opts, Acc) ->
case lists:keytake(userconfig, 1, Opts) of
- false->
- Acc;
- {value, {userconfig, {Callback, []}}, NewOpts}->
+ false ->
+ lists:reverse(Acc);
+ {value, {userconfig, Config=[{_,_}|_]}, NewOpts} ->
+ Acc1 = lists:map(fun({_Callback, []}=Cfg) ->
+ Cfg;
+ ({Callback, Files=[File|_]}) when is_list(File) ->
+ {Callback, Files};
+ ({Callback, File=[C|_]}) when is_integer(C) ->
+ {Callback, [File]}
+ end, Config),
+ process_user_configs(NewOpts, lists:reverse(Acc1)++Acc);
+ {value, {userconfig, {Callback, []}}, NewOpts} ->
process_user_configs(NewOpts, [{Callback, []} | Acc]);
- {value, {userconfig, {Callback, Files=[File|_]}}, NewOpts} when
- is_list(File) ->
+ {value, {userconfig, {Callback, Files=[File|_]}}, NewOpts} when is_list(File) ->
process_user_configs(NewOpts, [{Callback, Files} | Acc]);
- {value, {userconfig, {Callback, File=[C|_]}}, NewOpts} when
- is_integer(C) ->
+ {value, {userconfig, {Callback, File=[C|_]}}, NewOpts} when is_integer(C) ->
process_user_configs(NewOpts, [{Callback, [File]} | Acc])
end.