aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/src/ct_framework.erl
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2012-08-23 18:29:45 +0200
committerPeter Andersson <[email protected]>2012-08-23 18:29:45 +0200
commita94308cb1e1aa727a126e99b5a8714490dd3de16 (patch)
tree2452c3b837c23ab62cb16e363d56cfa095005a7e /lib/common_test/src/ct_framework.erl
parent38456cd45c8677a567e32722dee0d9602a306037 (diff)
parente2d5adbd9167ec51edaece5bf672c76e4898ca05 (diff)
downloadotp-a94308cb1e1aa727a126e99b5a8714490dd3de16.tar.gz
otp-a94308cb1e1aa727a126e99b5a8714490dd3de16.tar.bz2
otp-a94308cb1e1aa727a126e99b5a8714490dd3de16.zip
Merge remote branch 'origin/peppe/common_test/parallel_testcases_error' into maint
* origin/peppe/common_test/parallel_testcases_error: Solve problems with verbosity levels and parallel test cases
Diffstat (limited to 'lib/common_test/src/ct_framework.erl')
-rw-r--r--lib/common_test/src/ct_framework.erl31
1 files changed, 20 insertions, 11 deletions
diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl
index d698ebb5dc..e8d5d4708b 100644
--- a/lib/common_test/src/ct_framework.erl
+++ b/lib/common_test/src/ct_framework.erl
@@ -75,8 +75,11 @@ init_tc(Mod,Func,Config) ->
case CurrTC of
undefined ->
ct_util:set_testdata({curr_tc,[{Suite,Func}]});
- Running when is_list(Running) ->
- ct_util:set_testdata({curr_tc,[{Suite,Func}|Running]})
+ _ when is_list(CurrTC) ->
+ ct_util:update_testdata(curr_tc,
+ fun(Running) ->
+ [{Suite,Func}|Running]
+ end)
end,
case ct_util:read_suite_data({seq,Suite,Func}) of
undefined ->
@@ -84,11 +87,13 @@ init_tc(Mod,Func,Config) ->
Seq when is_atom(Seq) ->
case ct_util:read_suite_data({seq,Suite,Seq}) of
[Func|TCs] -> % this is the 1st case in Seq
- %% make sure no cases in this seq are marked as failed
- %% from an earlier execution in the same suite
+ %% make sure no cases in this seq are
+ %% marked as failed from an earlier execution
+ %% in the same suite
lists:foreach(
fun(TC) ->
- ct_util:save_suite_data({seq,Suite,TC},Seq)
+ ct_util:save_suite_data({seq,Suite,TC},
+ Seq)
end, TCs);
_ ->
ok
@@ -665,12 +670,16 @@ 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)
- case ct_util:get_testdata(curr_tc) of
- Running = [_,_|_] ->
- ct_util:set_testdata({curr_tc,lists:delete({Mod,Func}, Running)});
- [_] ->
- ct_util:set_testdata({curr_tc,undefined})
- end,
+ ClearCurrTC = fun(Running = [_,_|_]) ->
+ lists:delete({Mod,Func},Running);
+ ({_,{suite0_failed,_}}) ->
+ undefined;
+ ([{_,CurrTC}]) when CurrTC == Func ->
+ undefined;
+ (undefined) ->
+ undefined
+ end,
+ ct_util:update_testdata(curr_tc,ClearCurrTC),
case FinalResult of
{skip,{sequence_failed,_,_}} ->