diff options
author | Björn Gustavsson <[email protected]> | 2012-10-31 14:47:07 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2012-10-31 14:47:07 +0100 |
commit | c16c80532af30922cb222f75971cd2aecdb9e36c (patch) | |
tree | 9157a1e2e820594bffcfcbe1b9a28cfea377edc7 /lib/test_server/src/test_server_sup.erl | |
parent | bc252da80bdae41fa8aeee813da3365a651b801f (diff) | |
parent | a1bfc7b0abefe42aebd2616160b00c6bfdb9c4b6 (diff) | |
download | otp-c16c80532af30922cb222f75971cd2aecdb9e36c.tar.gz otp-c16c80532af30922cb222f75971cd2aecdb9e36c.tar.bz2 otp-c16c80532af30922cb222f75971cd2aecdb9e36c.zip |
Merge branch 'bjorn/ct/stability/OTP-10480'
* bjorn/ct/stability/OTP-10480:
Simplify managment of test_server_loc
Keep the information about the current test case consistent
test_server: Eliminate the Loc argument for do_end_tc_call()
Refactor the handling of the make_priv_dir message
test_server: Refactor run_test_case_msgloop()
Diffstat (limited to 'lib/test_server/src/test_server_sup.erl')
-rw-r--r-- | lib/test_server/src/test_server_sup.erl | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/lib/test_server/src/test_server_sup.erl b/lib/test_server/src/test_server_sup.erl index 4a27c1ebae..3d00318b1b 100644 --- a/lib/test_server/src/test_server_sup.erl +++ b/lib/test_server/src/test_server_sup.erl @@ -64,13 +64,7 @@ timetrap(Timeout0, ReportTVal, Scale, Pid) -> true -> ReportTVal end, MFLs = test_server:get_loc(Pid), Mon = erlang:monitor(process, Pid), - Trap = - case get(test_server_init_or_end_conf) of - undefined -> - {timetrap_timeout,TimeToReport,MFLs}; - InitOrEnd -> - {timetrap_timeout,TimeToReport,MFLs,InitOrEnd} - end, + Trap = {timetrap_timeout,TimeToReport,MFLs}, exit(Pid, Trap), receive {'DOWN', Mon, process, Pid, _} -> @@ -518,8 +512,18 @@ framework_call(Callback,Func,Args,DefaultReturn) -> end, case erlang:function_exported(Mod,Func,length(Args)) of true -> - put(test_server_loc, {Mod,Func,framework}), EH = fun(Reason) -> exit({fw_error,{Mod,Func,Reason}}) end, + SetTcState = case Func of + end_tc -> true; + init_tc -> true; + _ -> false + end, + case SetTcState of + true -> + test_server:set_tc_state({framework,Mod,Func}, undefined); + false -> + ok + end, try apply(Mod,Func,Args) of Result -> Result @@ -550,18 +554,6 @@ format_loc([{Mod,LineOrFunc}]) -> format_loc({Mod,LineOrFunc}); format_loc({Mod,Func}) when is_atom(Func) -> io_lib:format("{~s,~w}",[package_str(Mod),Func]); -format_loc({Mod,Line}) when is_integer(Line) -> - %% ?line macro is used - ModStr = package_str(Mod), - case {lists:member(no_src, get(test_server_logopts)), - lists:reverse(ModStr)} of - {false,[$E,$T,$I,$U,$S,$_|_]} -> - io_lib:format("{~s,<a href=\"~s~s#~w\">~w</a>}", - [ModStr,downcase(ModStr),?src_listing_ext, - round_to_10(Line),Line]); - _ -> - io_lib:format("{~s,~w}",[ModStr,Line]) - end; format_loc(Loc) -> io_lib:format("~p",[Loc]). |