aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2016-03-08 01:40:19 +0100
committerPeter Andersson <[email protected]>2016-03-08 09:36:20 +0100
commit9b9879b1ccbeff9ec87494ba7ed59273d679740e (patch)
tree605c8edf298887a7eb36b57468f2a97fe84bdf4c /lib/common_test
parent7a05d84c9d6664573a34485e3441b3c9542ed25b (diff)
downloadotp-9b9879b1ccbeff9ec87494ba7ed59273d679740e.tar.gz
otp-9b9879b1ccbeff9ec87494ba7ed59273d679740e.tar.bz2
otp-9b9879b1ccbeff9ec87494ba7ed59273d679740e.zip
Fix problems with formatted test_server printouts
Diffstat (limited to 'lib/common_test')
-rw-r--r--lib/common_test/src/ct_logs.erl6
-rw-r--r--lib/common_test/src/ct_util.erl6
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/common_test/src/ct_logs.erl b/lib/common_test/src/ct_logs.erl
index d9e9328bbd..e3f995ad3f 100644
--- a/lib/common_test/src/ct_logs.erl
+++ b/lib/common_test/src/ct_logs.erl
@@ -269,7 +269,7 @@ cast(Msg) ->
%%% <p>This function is called by ct_framework:init_tc/3</p>
init_tc(RefreshLog) ->
call({init_tc,self(),group_leader(),RefreshLog}),
- io:format(xhtml("", "<br />")),
+ io:format(["$tc_html",xhtml("", "<br />")]),
ok.
%%%-----------------------------------------------------------------
@@ -919,7 +919,7 @@ print_to_log(sync, FromPid, Category, TCGL, Content, EscChars, State) ->
if FromPid /= TCGL ->
IoFun = create_io_fun(FromPid, CtLogFd, EscChars),
IoList = lists:foldl(IoFun, [], Content),
- io:format(TCGL,"~ts", [IoList]);
+ io:format(TCGL,["$tc_html","~ts"], [IoList]);
true ->
unexpected_io(FromPid, Category, ?MAX_IMPORTANCE, Content,
CtLogFd, EscChars)
@@ -945,7 +945,7 @@ print_to_log(async, FromPid, Category, TCGL, Content, EscChars, State) ->
case erlang:is_process_alive(TCGL) of
true ->
- try io:format(TCGL, "~ts",
+ try io:format(TCGL, ["$tc_html","~ts"],
[lists:foldl(IoFun,[],Content)]) of
_ -> ok
catch
diff --git a/lib/common_test/src/ct_util.erl b/lib/common_test/src/ct_util.erl
index 445fce1db8..b7fa7947e2 100644
--- a/lib/common_test/src/ct_util.erl
+++ b/lib/common_test/src/ct_util.erl
@@ -485,6 +485,8 @@ loop(Mode,TestData,StartDir) ->
{'EXIT',Pid,Reason} ->
case ets:lookup(?conn_table,Pid) of
[#conn{address=A,callback=CB}] ->
+ ErrorStr = io_lib:format("~tp", [Reason]),
+ ErrorHtml = ct_logs:escape_chars(ErrorStr),
%% A connection crashed - remove the connection but don't die
ct_logs:tc_log_async(ct_error_notify,
?MAX_IMPORTANCE,
@@ -492,8 +494,8 @@ loop(Mode,TestData,StartDir) ->
"Connection process died: "
"Pid: ~w, Address: ~p, "
"Callback: ~w\n"
- "Reason: ~p\n\n",
- [Pid,A,CB,Reason]),
+ "Reason: ~ts\n\n",
+ [Pid,A,CB,ErrorHtml]),
catch CB:close(Pid),
%% in case CB:close failed to do this:
unregister_connection(Pid),