From b299052f8d69ef4fff19d83d0f75ded72d65e9e3 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 30 Nov 2010 18:25:36 +0100 Subject: Update ct_framework calls to allow manipulation of test results in end_tc without breaking backwards compatability (I hope) --- lib/common_test/src/ct_framework.erl | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'lib/common_test/src/ct_framework.erl') diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl index f7c07a5374..dbf367e4d8 100644 --- a/lib/common_test/src/ct_framework.erl +++ b/lib/common_test/src/ct_framework.erl @@ -484,21 +484,27 @@ end_tc(Mod,Func,TCPid,Result,Args,Return) -> case get('$test_server_framework_test') of undefined -> - FinalResult = ct_suite_callback:end_tc( - Mod, FuncSpec, Args, Result, Return), + {FinalResult,FinalNotify} = + case ct_suite_callback:end_tc( + Mod, FuncSpec, Args, Result, Return) of + '$ct_no_change' -> + {FinalResult = ok,Result}; + FinalResult -> + {FinalResult,FinalResult} + 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_scb(FinalResult)}}); + tag_scb(FinalNotify)}}); 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) + FinalResult = Fun(end_tc, Return) end, @@ -521,13 +527,7 @@ end_tc(Mod,Func,TCPid,Result,Args,Return) -> _ -> ok end, - case FinalResult of - Result -> - ok; - _Else -> - FinalResult - end. - + FinalResult. %% {error,Reason} | {skip,Reason} | {timetrap_timeout,TVal} | %% {testcase_aborted,Reason} | testcase_aborted_or_killed | -- cgit v1.2.3