diff options
author | Micael Karlberg <[email protected]> | 2018-12-14 19:14:43 +0100 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2018-12-18 12:16:24 +0100 |
commit | 6781913e975e93a4a29d14e14794aae4526de9f7 (patch) | |
tree | 3ce36a1a32fefaa391499de2247803a581900876 /erts/emulator/test/socket_test_lib.erl | |
parent | 2f80f039958b4ec6ab3306df777b6b1a4872a495 (diff) | |
download | otp-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.erl | 18 |
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(). |