aboutsummaryrefslogtreecommitdiffstats
path: root/lib/test_server/src/test_server.erl
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2010-11-30 18:25:36 +0100
committerLukas Larsson <[email protected]>2010-12-08 18:07:54 +0100
commitb299052f8d69ef4fff19d83d0f75ded72d65e9e3 (patch)
tree2b4421b8b9f495cad945724ffc8f4150e5b87346 /lib/test_server/src/test_server.erl
parentc0c7e05de55b83ed6d53da628cb345fc4f4da864 (diff)
downloadotp-b299052f8d69ef4fff19d83d0f75ded72d65e9e3.tar.gz
otp-b299052f8d69ef4fff19d83d0f75ded72d65e9e3.tar.bz2
otp-b299052f8d69ef4fff19d83d0f75ded72d65e9e3.zip
Update ct_framework calls to allow manipulation of test results in end_tc without breaking backwards compatability (I hope)
Diffstat (limited to 'lib/test_server/src/test_server.erl')
-rw-r--r--lib/test_server/src/test_server.erl34
1 files changed, 21 insertions, 13 deletions
diff --git a/lib/test_server/src/test_server.erl b/lib/test_server/src/test_server.erl
index daee278368..13ff02cc6c 100644
--- a/lib/test_server/src/test_server.erl
+++ b/lib/test_server/src/test_server.erl
@@ -1068,20 +1068,23 @@ run_test_case_eval(Mod, Func, Args0, Name, Ref, RunInit,
{ok,Args} ->
run_test_case_eval1(Mod, Func, Args, Name, RunInit, TCCallback);
Error = {error,_Reason} ->
- do_end_tc_call(Mod,Func,{Error,Args0}, Error),
- {{0,{skip,{failed,Error}}},{Mod,Func},[]};
+ NewResult = do_end_tc_call(Mod,Func,{Error,Args0},
+ {skip,{failed,Error}}),
+ {{0,NewResult},{Mod,Func},[]};
{fail,Reason} ->
[Conf] = Args0,
Conf1 = [{tc_status,{failed,Reason}} | Conf],
fw_error_notify(Mod, Func, Conf, Reason),
- do_end_tc_call(Mod,Func, {{error,Reason},[Conf1]},{fail, Reason}),
- {{0,{failed,Reason}},{Mod,Func},[]};
+ NewResult = do_end_tc_call(Mod,Func, {{error,Reason},[Conf1]},
+ {fail, Reason}),
+ {{0,NewResult},{Mod,Func},[]};
Skip = {skip,_Reason} ->
- do_end_tc_call(Mod,Func,{Skip,Args0},Skip),
- {{0,Skip},{Mod,Func},[]};
+ NewResult = do_end_tc_call(Mod,Func,{Skip,Args0},Skip),
+ {{0,NewResult},{Mod,Func},[]};
{auto_skip,Reason} ->
- do_end_tc_call(Mod, Func, {{skip,Reason},Args0}, {auto_skip, Reason}),
- {{0,{skip,{fw_auto_skip,Reason}}},{Mod,Func},[]}
+ NewResult = do_end_tc_call(Mod, Func, {{skip,Reason},Args0},
+ {skip, {fw_auto_skip,Reason}}),
+ {{0,NewResult},{Mod,Func},[]}
end,
exit({Ref,Time,Value,Loc,Opts}).
@@ -1187,7 +1190,12 @@ do_end_tc_call(M,F,Res,Return) ->
{fail,FWReason} ->
{failed,FWReason};
ok ->
- Return;
+ case Return of
+ {fail,Reason} ->
+ {failed,Reason};
+ Return ->
+ Return
+ end;
NewReturn ->
NewReturn
end;
@@ -1231,8 +1239,8 @@ process_return_val1([Failed={E,TCError}|_], M,F,A=[Args], Loc, _, SaveOpts)
[[{tc_status,{failed,TCError}}|Args]]}, Failed) of
{failed,FWReason} ->
{{failed,FWReason},SaveOpts};
- _ ->
- {Failed,SaveOpts}
+ NewReturn ->
+ {NewReturn,SaveOpts}
end;
process_return_val1([SaveCfg={save_config,_}|Opts], M,F,[Args], Loc, Final, SaveOpts) ->
process_return_val1(Opts, M,F,[[SaveCfg|Args]], Loc, Final, SaveOpts);
@@ -1249,8 +1257,8 @@ process_return_val1([], M,F,A, _Loc, Final, SaveOpts) ->
case do_end_tc_call(M,F,{Final,A}, Final) of
{failed,FWReason} ->
{{failed,FWReason},SaveOpts};
- _ ->
- {Final,lists:reverse(SaveOpts)}
+ NewReturn ->
+ {NewReturn,lists:reverse(SaveOpts)}
end.
user_callback(undefined, _, _, _, Args) ->