aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/common_test/src/ct_framework.erl43
1 files changed, 27 insertions, 16 deletions
diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl
index 54d0433eef..487f093d38 100644
--- a/lib/common_test/src/ct_framework.erl
+++ b/lib/common_test/src/ct_framework.erl
@@ -482,19 +482,25 @@ end_tc(Mod,Func,TCPid,Result,Args,Return) ->
end,
ct_util:reset_silent_connections(),
- FinalResult = case get('$test_server_framework_test') of
- undefined ->
- ct_suite_callback:end_tc(
- Mod, FuncSpec, Args, Return);
- Fun ->
- Fun(end_tc, ok)
- end,
-
- %% send sync notification so that event handlers may print
- %% in the log file before it gets closed
- ct_event:sync_notify(#event{name=tc_done,
- node=node(),
- data={Mod,FuncSpec,tag(FinalResult)}}),
+ case get('$test_server_framework_test') of
+ undefined ->
+ FinalResult = ct_suite_callback:end_tc(
+ Mod, FuncSpec, Args, Result),
+ % send sync notification so that event handlers may print
+ % in the log file before it gets closed
+ ct_event:sync_notify(#event{name=tc_done,
+ node=node(),
+ data={Mod,FuncSpec,tag(FinalResult)}});
+ Fun ->
+ % send sync notification so that event handlers may print
+ % in the log file before it gets closed
+ ct_event:sync_notify(#event{name=tc_done,
+ node=node(),
+ data={Mod,FuncSpec,tag(Result)}}),
+ FinalResult = Fun(end_tc, ok)
+ end,
+
+
case FinalResult of
{skip,{sequence_failed,_,_}} ->
%% ct_logs:init_tc is never called for a skipped test case
@@ -513,7 +519,14 @@ end_tc(Mod,Func,TCPid,Result,Args,Return) ->
ct_util:match_delete_suite_data({seq,Mod,'_'});
_ ->
ok
- end, FinalResult.
+ end,
+ case FinalResult of
+ Result ->
+ ok;
+ _Else ->
+ FinalResult
+ end.
+
%% {error,Reason} | {skip,Reason} | {timetrap_timeout,TVal} |
%% {testcase_aborted,Reason} | testcase_aborted_or_killed |
@@ -526,8 +539,6 @@ tag(E = {ETag,_}) when ETag == error; ETag == 'EXIT';
{failed,E};
tag(E = testcase_aborted_or_killed) ->
{failed,E};
-tag(Other) when is_list(Other) ->
- ok;
tag(Other) ->
Other.