aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test/socket_test_lib.erl
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2018-12-14 19:14:43 +0100
committerMicael Karlberg <[email protected]>2018-12-18 12:16:24 +0100
commit6781913e975e93a4a29d14e14794aae4526de9f7 (patch)
tree3ce36a1a32fefaa391499de2247803a581900876 /erts/emulator/test/socket_test_lib.erl
parent2f80f039958b4ec6ab3306df777b6b1a4872a495 (diff)
downloadotp-6781913e975e93a4a29d14e14794aae4526de9f7.tar.gz
otp-6781913e975e93a4a29d14e14794aae4526de9f7.tar.bz2
otp-6781913e975e93a4a29d14e14794aae4526de9f7.zip
[socket-nif|test] Add test case based on the ttest modules
Added a (first) test case based on the ttest modules. OTP-14831
Diffstat (limited to 'erts/emulator/test/socket_test_lib.erl')
-rw-r--r--erts/emulator/test/socket_test_lib.erl18
1 files changed, 18 insertions, 0 deletions
diff --git a/erts/emulator/test/socket_test_lib.erl b/erts/emulator/test/socket_test_lib.erl
index f55f338ef9..4e65c4f3c0 100644
--- a/erts/emulator/test/socket_test_lib.erl
+++ b/erts/emulator/test/socket_test_lib.erl
@@ -21,6 +21,8 @@
-module(socket_test_lib).
-export([
+ pi/1, pi/2, pi/3,
+
%% Time stuff
timestamp/0,
tdiff/2,
@@ -38,6 +40,22 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+pi(Item) when is_atom(Item) ->
+ pi(self(), Item).
+
+pi(Pid, Item) when is_pid(Pid) andalso is_atom(Item) ->
+ {Item, Info} = process_info(Pid, Item),
+ Info;
+pi(Node, Pid) when is_pid(Pid) ->
+ rpc:call(Node, erlang, process_info, [Pid]).
+
+pi(Node, Pid, Item) when is_pid(Pid) andalso is_atom(Item) ->
+ rpc:call(Node, erlang, process_info, [Pid, Item]).
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
timestamp() ->
os:timestamp().