aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test/socket_test_evaluator.erl
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2018-12-13 16:38:52 +0100
committerMicael Karlberg <[email protected]>2018-12-14 12:03:05 +0100
commitaed92219aacf962a9d6c71ea448809fe2c9acae6 (patch)
tree0c7ee62dfbf9dce930433b94785cf50911b10720 /erts/emulator/test/socket_test_evaluator.erl
parent73eae9c9c3e458d6d6cffb0cdbfb6ce80a340be1 (diff)
downloadotp-aed92219aacf962a9d6c71ea448809fe2c9acae6.tar.gz
otp-aed92219aacf962a9d6c71ea448809fe2c9acae6.tar.bz2
otp-aed92219aacf962a9d6c71ea448809fe2c9acae6.zip
[socket-nif|test] Add a "global" logger
Added a global logger that make it possible to log from the slave nodes (with "ease"). Also "fixed" the test case that failed on "older" linux (Ubuntu 14.04). For now we let it skip instead (we should really check the OS version). Also corrected a couple of (ping-pong) cases for which the buffer adjustments did not work. OTP-14831
Diffstat (limited to 'erts/emulator/test/socket_test_evaluator.erl')
-rw-r--r--erts/emulator/test/socket_test_evaluator.erl10
1 files changed, 7 insertions, 3 deletions
diff --git a/erts/emulator/test/socket_test_evaluator.erl b/erts/emulator/test/socket_test_evaluator.erl
index e8755a9512..48fb6a027e 100644
--- a/erts/emulator/test/socket_test_evaluator.erl
+++ b/erts/emulator/test/socket_test_evaluator.erl
@@ -76,6 +76,7 @@
%% ============================================================================
-define(LIB, socket_test_lib).
+-define(LOGGER, socket_test_logger).
-define(EXTRA_NOTHING, '$nothing').
-define(ANNOUNCEMENT_START, '$start').
@@ -122,6 +123,8 @@ loop(ID, [#{desc := Desc,
loop(ID + 1, Cmds, State);
{ok, NewState} ->
loop(ID + 1, Cmds, NewState);
+ {skip, Reason} ->
+ exit({skip, Reason});
{error, Reason} ->
eprint("command ~w failed: "
"~n Reason: ~p", [ID, Reason]),
@@ -160,6 +163,8 @@ await_finish(Evs, Fails) ->
iprint("unknown process ~p died (normal)", [Pid]),
await_finish(Evs, Fails)
end;
+ {'DOWN', _MRef, process, Pid, {skip, Reason}} ->
+ ?LIB:skip(Reason);
{'DOWN', _MRef, process, Pid, Reason} ->
case lists:keysearch(Pid, #ev.pid, Evs) of
{value, #ev{name = Name}} ->
@@ -486,6 +491,5 @@ print(Prefix, F, A) ->
SName ->
f("[~s][~p]", [SName, self()])
end,
- FStr = f("[~s]~s ~s" ++ F, [?LIB:formated_timestamp(), IDStr, Prefix | A]),
- io:format(user, FStr ++ "~n", []),
- io:format(FStr, []).
+ ?LOGGER:format("[~s]~s ~s" ++ F,
+ [?LIB:formated_timestamp(), IDStr, Prefix | A]).