diff options
author | Sverker Eriksson <[email protected]> | 2016-10-18 17:59:06 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2016-10-18 17:59:06 +0200 |
commit | 72026389d89a2e9530d3594df742588bace7079a (patch) | |
tree | 523af8c4319cc4a8cb114e1e0762db70511cf6b3 /lib/kernel | |
parent | c8f3ec52716064e0835e2e84329b2257be22acb2 (diff) | |
download | otp-72026389d89a2e9530d3594df742588bace7079a.tar.gz otp-72026389d89a2e9530d3594df742588bace7079a.tar.bz2 otp-72026389d89a2e9530d3594df742588bace7079a.zip |
kernel: Reduce test logging
from code_SUITE:upgrade
Diffstat (limited to 'lib/kernel')
-rw-r--r-- | lib/kernel/test/code_SUITE.erl | 4 | ||||
-rw-r--r-- | lib/kernel/test/code_SUITE_data/upgrade_client.erl | 28 |
2 files changed, 19 insertions, 13 deletions
diff --git a/lib/kernel/test/code_SUITE.erl b/lib/kernel/test/code_SUITE.erl index 237f1c46b6..8d517d144e 100644 --- a/lib/kernel/test/code_SUITE.erl +++ b/lib/kernel/test/code_SUITE.erl @@ -506,7 +506,7 @@ upgrade_do(DataDir, Client, T) -> ok. compile_load(Mod, Dir, Ver, CodeType) -> - erlang:display({"{{{{{{{{{{{{{{{{Loading",Mod,Ver,CodeType}), + %%erlang:display({"{{{{{{{{{{{{{{{{Loading",Mod,Ver,CodeType}), Version = case Ver of undefined -> io:format("Compiling '~p' as ~p\n", [Mod, CodeType]), @@ -532,7 +532,7 @@ compile_load(Mod, Dir, Ver, CodeType) -> T3 = erlang:now(), io:format("Compile time ~p ms, Load time ~p ms\n", [timer:now_diff(T2,T1) div 1000, timer:now_diff(T3,T2) div 1000]), - erlang:display({"}}}}}}}}}}}}}}}Loaded",Mod,Ver,CodeType}), + %%erlang:display({"}}}}}}}}}}}}}}}Loaded",Mod,Ver,CodeType}), ok. dir_req(Config) when is_list(Config) -> diff --git a/lib/kernel/test/code_SUITE_data/upgrade_client.erl b/lib/kernel/test/code_SUITE_data/upgrade_client.erl index 98d36f6014..faa18e1410 100644 --- a/lib/kernel/test/code_SUITE_data/upgrade_client.erl +++ b/lib/kernel/test/code_SUITE_data/upgrade_client.erl @@ -65,7 +65,7 @@ run(Dir, Upgradee1, Upgradee2, Other1, Other2) -> put(exp1exp2_fun, upgradee:get_exp1exp2_fun()), ?line 1 = (get(exp1exp2_fun))(), - ?line 13 = check_tracing(Tracer), + ok = check_tracing(Tracer, 13), %% %% Load version 1 of other @@ -89,7 +89,7 @@ run(Dir, Upgradee1, Upgradee2, Other1, Other2) -> ?line {'EXIT',{undef,_}} = proxy_call(P, other, exp2), ?line {'EXIT',{undef,_}} = proxy_call(P, other, loc2), - ?line 5 = check_tracing(Tracer), + ok = check_tracing(Tracer, 5), %% %% Load version 2 of upgradee @@ -150,7 +150,7 @@ run(Dir, Upgradee1, Upgradee2, Other1, Other2) -> ?line 2 = (get(exp1exp2_fun))(), - ?line 10 = check_tracing(Tracer), + ok = check_tracing(Tracer, 10), %% %% Load version 2 of other @@ -208,7 +208,7 @@ run(Dir, Upgradee1, Upgradee2, Other1, Other2) -> ?line {2,Env2} = (get(loc2_fun))(), ?line 2 = (get(exp1exp2_fun))(), - ?line 10 = check_tracing(Tracer), + ok = check_tracing(Tracer, 10), %% %% Upgrade proxy to version 2 @@ -273,7 +273,7 @@ run(Dir, Upgradee1, Upgradee2, Other1, Other2) -> ?line {'EXIT',{undef,_}} = (catch (get(exp1exp2_fun))()), - ?line 14 = check_tracing(Tracer), + ok = check_tracing(Tracer, 14), unlink(P), exit(P, die_please), @@ -319,18 +319,24 @@ tracer_loop(Receiver) -> tracer_loop(Receiver) end. -check_tracing(Tracer) -> +check_tracing(Tracer, Expected) -> Tracer ! {do_trace_delivered, self()}, - check_tracing_loop(0). + case check_tracing_loop(0,[]) of + {Expected,_} -> + ok; + {Got, MsgList} -> + io:format("Expected ~p trace msg, got ~p:\n~p\n", + [Expected, Got, lists:reverse(MsgList)]), + "Trace msg mismatch" + end. -check_tracing_loop(N) -> +check_tracing_loop(N, MsgList) -> Self = self(), receive {trace, _Pid, call, {_M, _F, _Args}} = Msg -> - io:format("Trace: ~p\n",[Msg]), - check_tracing_loop(N+1); + check_tracing_loop(N+1, [Msg | MsgList]); {trace_delivered, Self, _} -> - N + {N, MsgList} end. |