aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2010-11-22 15:30:46 +0100
committerLukas Larsson <[email protected]>2010-12-08 18:07:51 +0100
commit25dfebe8122488db306378eefb8d4ede5e4da601 (patch)
treea56effeb9be408c64a52cd16a40e1e6fd30e9608 /lib
parent07673c7267b222101ab102112eff9f96049cd308 (diff)
downloadotp-25dfebe8122488db306378eefb8d4ede5e4da601.tar.gz
otp-25dfebe8122488db306378eefb8d4ede5e4da601.tar.bz2
otp-25dfebe8122488db306378eefb8d4ede5e4da601.zip
Update to be compatible with how common_test tests the ct framework
Diffstat (limited to 'lib')
-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.