aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/kernel/test/code_SUITE.erl4
-rw-r--r--lib/kernel/test/code_SUITE_data/upgrade_client.erl28
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.