aboutsummaryrefslogtreecommitdiffstats
path: root/lib/observer/test/crashdump_helper.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2018-10-19 10:29:31 +0200
committerBjörn Gustavsson <[email protected]>2018-11-06 10:01:23 +0100
commit8f78c9bc750acae397a727964d8aeb93331b5fb3 (patch)
treee3ee089d2f4ce09fdce99340e636e8aaadbf662e /lib/observer/test/crashdump_helper.erl
parent805748eb668d5562fe17f3172cdae07a86166c3f (diff)
downloadotp-8f78c9bc750acae397a727964d8aeb93331b5fb3.tar.gz
otp-8f78c9bc750acae397a727964d8aeb93331b5fb3.tar.bz2
otp-8f78c9bc750acae397a727964d8aeb93331b5fb3.zip
Add tests of persistent terms for crashdump_viewer
Diffstat (limited to 'lib/observer/test/crashdump_helper.erl')
-rw-r--r--lib/observer/test/crashdump_helper.erl28
1 files changed, 27 insertions, 1 deletions
diff --git a/lib/observer/test/crashdump_helper.erl b/lib/observer/test/crashdump_helper.erl
index d8f4e046ae..576d112154 100644
--- a/lib/observer/test/crashdump_helper.erl
+++ b/lib/observer/test/crashdump_helper.erl
@@ -21,7 +21,9 @@
-module(crashdump_helper).
-export([n1_proc/2,remote_proc/2,
dump_maps/0,create_maps/0,
- create_binaries/0,create_sub_binaries/1]).
+ create_binaries/0,create_sub_binaries/1,
+ dump_persistent_terms/0,
+ create_persistent_terms/0]).
-compile(r18).
-include_lib("common_test/include/ct.hrl").
@@ -162,3 +164,27 @@ literal_map() ->
%% Adress1, then the map at Address2.
#{"one"=>1,"two"=>2,"three"=>3,"four"=>4}.
+
+%%%
+%%% Test dumping of persistent terms (from OTP 21.2).
+%%%
+
+dump_persistent_terms() ->
+ Parent = self(),
+ F = fun() ->
+ register(aaaaaaaa_persistent_terms, self()),
+ put(pts, create_persistent_terms()),
+ Parent ! {self(),done},
+ receive _ -> ok end
+ end,
+ Pid = spawn_link(F),
+ receive
+ {Pid,done} ->
+ {ok,Pid}
+ end.
+
+create_persistent_terms() ->
+ persistent_term:put({?MODULE,first}, {pid,42.0}),
+ persistent_term:put({?MODULE,second}, [1,2,3]),
+ persistent_term:get().
+