aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/src
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2010-11-18 14:10:08 +0100
committerLukas Larsson <[email protected]>2010-12-08 18:07:48 +0100
commit90dac5ad22aefa725731b637e8128474aa6f7bdc (patch)
tree55aef132d30399d588979d17f20dd3c7f9b273f6 /lib/common_test/src
parent9809d4a71dc48fd52ec8b4d3d2002b2facf323e7 (diff)
downloadotp-90dac5ad22aefa725731b637e8128474aa6f7bdc.tar.gz
otp-90dac5ad22aefa725731b637e8128474aa6f7bdc.tar.bz2
otp-90dac5ad22aefa725731b637e8128474aa6f7bdc.zip
Move end_tc call to be made before the tc_done event is generated
Diffstat (limited to 'lib/common_test/src')
-rw-r--r--lib/common_test/src/ct_framework.erl23
1 files changed, 13 insertions, 10 deletions
diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl
index ac10bddefc..54d0433eef 100644
--- a/lib/common_test/src/ct_framework.erl
+++ b/lib/common_test/src/ct_framework.erl
@@ -482,12 +482,20 @@ 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(Result)}}),
- case Result of
+ data={Mod,FuncSpec,tag(FinalResult)}}),
+ case FinalResult of
{skip,{sequence_failed,_,_}} ->
%% ct_logs:init_tc is never called for a skipped test case
%% in a failing sequence, so neither should end_tc
@@ -505,14 +513,7 @@ end_tc(Mod,Func,TCPid,Result,Args,Return) ->
ct_util:match_delete_suite_data({seq,Mod,'_'});
_ ->
ok
- end,
- case get('$test_server_framework_test') of
- undefined ->
- ct_suite_callback:end_tc(
- Mod, FuncSpec, Args, Return);
- Fun ->
- Fun(end_tc, ok)
- end.
+ end, FinalResult.
%% {error,Reason} | {skip,Reason} | {timetrap_timeout,TVal} |
%% {testcase_aborted,Reason} | testcase_aborted_or_killed |
@@ -525,6 +526,8 @@ 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.