aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/src/ct_framework.erl
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2012-08-23 16:50:52 +0200
committerPeter Andersson <[email protected]>2012-08-23 16:50:52 +0200
commitc8969d42acbdff2c65f48a27dcd1cb36b15d4b87 (patch)
treeefbabc7344c7622e6230f765c59dd7cae33ab45e /lib/common_test/src/ct_framework.erl
parent182564757661d6cd507d2e92d175c61602a25394 (diff)
parentc41fbd49054693d61f9f78ef92da176aeea3bf83 (diff)
downloadotp-c8969d42acbdff2c65f48a27dcd1cb36b15d4b87.tar.gz
otp-c8969d42acbdff2c65f48a27dcd1cb36b15d4b87.tar.bz2
otp-c8969d42acbdff2c65f48a27dcd1cb36b15d4b87.zip
Merge remote branch 'origin/peppe/common_test/break_and_continue' into maint
* origin/peppe/common_test/break_and_continue: Fix error in documentation Implement support for test case execution break/continue Conflicts: lib/common_test/src/ct.erl lib/common_test/src/ct_run.erl OTP-10127 OTP-10172
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 19a26872ee..d698ebb5dc 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}};
@@ -656,7 +662,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