aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/src/ct_framework.erl
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2012-07-15 01:48:03 +0200
committerPeter Andersson <[email protected]>2012-08-08 14:20:30 +0200
commit2a3fc026842241b0a1e1b2b1f691bd212499ffe0 (patch)
tree26734b39e09bcea382413a6570ee3874d4c906a2 /lib/common_test/src/ct_framework.erl
parentbb1734e95a5f6a7315819c24bc1fdd799534c787 (diff)
downloadotp-2a3fc026842241b0a1e1b2b1f691bd212499ffe0.tar.gz
otp-2a3fc026842241b0a1e1b2b1f691bd212499ffe0.tar.bz2
otp-2a3fc026842241b0a1e1b2b1f691bd212499ffe0.zip
Implement support for test case execution break/continue
Diffstat (limited to 'lib/common_test/src/ct_framework.erl')
-rw-r--r--lib/common_test/src/ct_framework.erl23
1 files changed, 19 insertions, 4 deletions
diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl
index 11575cd0fb..0740eb7ec9 100644
--- a/lib/common_test/src/ct_framework.erl
+++ b/lib/common_test/src/ct_framework.erl
@@ -71,8 +71,13 @@ init_tc(Mod,Func,Config) ->
{skip,{require_failed_in_suite0,Reason}};
{Suite,{suite0_failed,_}=Failure} ->
{skip,Failure};
- _ ->
- ct_util:set_testdata({curr_tc,{Suite,Func}}),
+ CurrTC ->
+ 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]})
+ end,
case ct_util:read_suite_data({seq,Suite,Func}) of
undefined ->
init_tc1(Mod,Suite,Func,Config);
@@ -206,7 +211,8 @@ init_tc2(Mod,Suite,Func,SuiteInfo,MergeResult,Config) ->
case catch configure(MergedInfo,MergedInfo,SuiteInfo,
FuncSpec,Config) of
{suite0_failed,Reason} ->
- ct_util:set_testdata({curr_tc,{Mod,{suite0_failed,{require,Reason}}}}),
+ ct_util:set_testdata({curr_tc,{Mod,{suite0_failed,
+ {require,Reason}}}}),
{skip,{require_failed_in_suite0,Reason}};
{error,Reason} ->
{auto_skip,{require_failed,Reason}};
@@ -633,7 +639,16 @@ end_tc(Mod,Func,TCPid,Result,Args,Return) ->
end,
ct_util:reset_silent_connections(),
-
+
+ %% 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,
+
case FinalResult of
{skip,{sequence_failed,_,_}} ->
%% ct_logs:init_tc is never called for a skipped test case