aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/src/ct_framework.erl
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2012-08-24 15:02:36 +0200
committerPeter Andersson <[email protected]>2012-08-24 16:55:26 +0200
commit00455b5fec96bf320fc8b3656bb9dbd0395fa23b (patch)
treee62a013e94079b83a6dbb5d7db85d1d01d12050e /lib/common_test/src/ct_framework.erl
parent313355eb792d9bc811b5cb979a7cf9fbc9a6c075 (diff)
downloadotp-00455b5fec96bf320fc8b3656bb9dbd0395fa23b.tar.gz
otp-00455b5fec96bf320fc8b3656bb9dbd0395fa23b.tar.bz2
otp-00455b5fec96bf320fc8b3656bb9dbd0395fa23b.zip
Solve problem with registering parallel testcases
Diffstat (limited to 'lib/common_test/src/ct_framework.erl')
-rw-r--r--lib/common_test/src/ct_framework.erl23
1 files changed, 11 insertions, 12 deletions
diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl
index e8d5d4708b..4d47731239 100644
--- a/lib/common_test/src/ct_framework.erl
+++ b/lib/common_test/src/ct_framework.erl
@@ -71,16 +71,13 @@ init_tc(Mod,Func,Config) ->
{skip,{require_failed_in_suite0,Reason}};
{Suite,{suite0_failed,_}=Failure} ->
{skip,Failure};
- CurrTC ->
- case CurrTC of
- undefined ->
- ct_util:set_testdata({curr_tc,[{Suite,Func}]});
- _ when is_list(CurrTC) ->
- ct_util:update_testdata(curr_tc,
- fun(Running) ->
- [{Suite,Func}|Running]
- end)
- end,
+ _ ->
+ ct_util:update_testdata(curr_tc,
+ fun(undefined) ->
+ [{Suite,Func}];
+ (Running) ->
+ [{Suite,Func}|Running]
+ end, [create]),
case ct_util:read_suite_data({seq,Suite,Func}) of
undefined ->
init_tc1(Mod,Suite,Func,Config);
@@ -671,13 +668,15 @@ end_tc(Mod,Func,TCPid,Result,Args,Return) ->
%% reset the curr_tc state, or delete this TC from the list of
%% executing cases (if in a parallel group)
ClearCurrTC = fun(Running = [_,_|_]) ->
- lists:delete({Mod,Func},Running);
+ lists:keydelete(Func,2,Running);
({_,{suite0_failed,_}}) ->
undefined;
([{_,CurrTC}]) when CurrTC == Func ->
undefined;
(undefined) ->
- undefined
+ undefined;
+ (Unexpected) ->
+ exit({error,{reset_curr_tc,{Mod,Func},Unexpected}})
end,
ct_util:update_testdata(curr_tc,ClearCurrTC),